anjlab / bootstrap-rails

Twitter Bootstrap CSS (with Sass flavour) and JS toolkits for Rails 3 projects
https://github.com/anjlab/bootstrap-rails
729 stars 96 forks source link

Allow to exclude sprites module from bootstrap so that we can integrate with Font-Awesome #25

Closed pzgz closed 12 years ago

pzgz commented 12 years ago

Font-Awesome and Font-Awesome-More are great extension to bootstrap for adding some more free icons. To use them, we have to exclude the sprites module when applying bootstrap framework. This commit allow developers to import "twitter/bootstrap-no-sprites" with all the modules except the "sprites" module. So that we can import Font-Awesome module after bootstrap.

coreyward commented 12 years ago

This is entirely unnecessary. You can avoid importing the sprites at all by simply not importing the sprites at all. If you use the more convenient @import "bootstrap"; you're asking to import the whole of Bootstrap, and that's what you should get. If you want to get more specific, and I argue you should once you get around to optimization after your buildout, then you import just the pieces you need and omit the parts you don't.

pzgz commented 12 years ago

Well, thanks for your advice, I think you are right.

I created one SCSS file in my project, with all modules except the sprites module, and then I import that new scss file instead of the bootstrap one. The only cons is, we have to make sure the file get updated if there's any updates from bootstrap itself, on this file.

The file is looks like:


// Core variables and mixins
@import "twitter/bootstrap/variables.scss"; // Modify this for custom colors, font-sizes, etc
@import "twitter/bootstrap/mixins.scss";

// CSS Reset
@import "twitter/bootstrap/reset.scss";

// Grid system and page structure
@import "twitter/bootstrap/scaffolding.scss";
@import "twitter/bootstrap/grid.scss";
@import "twitter/bootstrap/layouts.scss";
...