Official Sass port of Bootstrap 2 and 3.
Go to file
Thomas McDonald 931fbc67b4 Add rake:debug task to quickly build the CSS
Previously to ensure that changes have been working it was required to
build the gem and then push it to a sample application (e.g. Rails &
Compass).

The rake:debug task uses plain Sass - as we do for testing, and creates
the file 'debug.css' without having to rebuild the Gem and fire up an
application.
2012-05-12 08:24:22 +01:00
lib Register the rails engine when using Rails w/Compass 2012-05-11 14:39:47 +01:00
templates/project SASS -> Sass 2012-03-28 14:13:39 +01:00
test Register the rails engine when using Rails w/Compass 2012-05-11 14:39:47 +01:00
vendor/assets Revert back to generating the grid with a for loop. 2012-05-12 08:15:32 +01:00
.gitignore Add rake:debug task to quickly build the CSS 2012-05-12 08:24:22 +01:00
.travis.yml test in ruby 1.9 please 2012-05-06 19:52:45 +01:00
CHANGELOG.md changelog updates to date 2012-04-25 23:19:05 +01:00
LICENSE Extracted Bootstrap from QA 2011-09-06 20:08:31 +01:00
README.md add build status icon 2012-05-11 14:38:25 +01:00
Rakefile Add rake:debug task to quickly build the CSS 2012-05-12 08:24:22 +01:00
bootstrap-sass.gemspec version -> 2.0.3 2012-04-25 22:28:44 +01:00

README.md

Bootstrap for Sass

Build Status

bootstrap-sass is an Sass-powered version of Twitter's Bootstrap, ready to drop right into your Sass powered applications.

Enjoy.

Updating

Updating your application to a new version of bootstrap-sass? See our changelog, Bootstrap's changelog, and this guide to updating to Bootstrap 2.0

Usage

Rails

In your Gemfile:

gem 'sass-rails', '~> 3.1'
gem 'bootstrap-sass', '~> 2.0.2'

CSS

Import "bootstrap" in your SCSS file of choice to get all of Bootstrap's styles, mixins and variables! We recommend against using //= require directives, since none of your other stylesheets will be able to use the awesome mixins that Bootstrap has defined.

@import "bootstrap";

Need to configure a variable or two? Simple define the value of the variable you want to change before importing Bootstrap. Sass will respect your existing definition rather than overwriting it with the Bootstrap defaults. A list of customisable variables can be found in the Bootstrap documentation.

$primaryButtonBackground: #f00;
@import "bootstrap";

Note: It's important that the file you are importing is not named bootstrap, since this will cause an import loop. As a general rule, errors are something you should try to avoid.

Javascripts

You can include the Bootstrap javascripts through two methods. In this case, Sprocket's //= require directives are useful, since there is no better alternative.

We have a helper that includes all available javascripts:

// Loads all Bootstrap javascripts
//= require bootstrap

You can also load individual modules, provided you sort out any related dependencies.

//= require bootstrap-scrollspy
//= require bootstrap-modal
//= require bootstrap-dropdown

Simples.

Compass

bootstrap-sass 2.0 now comes with support for Compass, meaning projects that don't use Rails can get in on the fun Bootstrap web.

New project

Install the gem and create a new project using the gem.

gem install bootstrap-sass
compass create compass-test -r bootstrap-sass --using bootstrap

This will sort a few things out:

  • You'll get a starting styles.scss ready for your alterations
  • You'll get a compiled stylesheet compiled & ready to drop into your application
  • We'll also copy the Bootstrap javascripts & images into their respective folders for you, absolutely free of charge! How cool is that?

Existing project

Install the gem, add the require statement to the top of your configuration file, and install the extension.

gem install bootstrap-sass

# In config.rb
require 'bootstrap-sass'

compass install bootstrap

You'll get the same benefits as those starting from scratch. Radical.


As per the Bootstrap project we don't include the responsive styles by default. @import "bootstrap-responsive"; to get them.