Use Foundation instead of Bootstrap with SASS in a yeoman created application

久未见 提交于 2019-12-04 19:45:27

This is what I've done, there might be more to it and hopefully someone else can find out, but it's working as expected so far. Hope this helps:

First you want to exclude foundation.css from the wiredep section of gruntfile.js. Do this by adding exclude: ['foundation.css'], to the wiredep section: (this will remove the call to foundation.css in head of index.html"

// Automatically inject Bower components into the app
wiredep: {
 ...//
 app: {
   src: ['<%= yeoman.app %>/index.html'],
   exclude: ['foundation.css'],
   ignorePath:  /..\//
 },
 ...//
},

Then, in the compass section of gruntfile.js, change the importPath to access the scss files located in bower_components/foundation/scss:

compass: {
   options: {
   ...//
     importPath: './bower_components/foundation/scss',
   //...
   }
}

Lastly, in app/styles, add the common scss files for foundation.

Following Yeoman Angular's naming convention, main.scss could look like this:

@import 
    "normalize",  // import from bower_components/foundation
    "settings",   // your custom _settings.scss file in app/styles directory
    "foundation"; // import from bower_components/foundation

Pardon any unclear or missing steps as I wrote this rather quickly. I also have steps to use libsass using grunt-sass, but I removed them figuring that it's out of scope for this question.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!