Home

Awesome

<img src="https://images.thoughtbot.com/bourbon/bourbon-logo.svg" width="200" alt="Bourbon logo">

Reviewed by Hound

Deprecated as of September 13, 2024

This project is no longer maintained. We encourage people to leverage the modern native CSS features in lieu of this library. You can refer to our blog post on how to go about replacing or rethinking each helper.

A Lightweight Sass Tool Set

Bourbon is a library of Sass mixins and functions that are designed to make you a more efficient style sheet author.

It is…

Helpful Links

Table of Contents

Requirements

Installation

  1. Install the Bourbon gem using the RubyGems package manager:

    gem install bourbon
    
  2. Install the Bourbon library into the current directory:

    bourbon install
    

    Pro Tip: You can target installation into a specific directory using the path flag:

    bourbon install --path my/custom/path/
    
  3. Import Bourbon at the beginning of your stylesheet:

    @import "bourbon/bourbon";
    

    It’s not recommended that you modify Bourbon’s files directly as it will make updating to future versions difficult, by overwriting your custom changes or causing merge conflicts.

Installation for Ruby on Rails 4.2+

  1. Add Bourbon to your Gemfile:

    gem "bourbon"
    
  2. Then run:

    bundle install
    
  3. Restart your server and rename application.css to application.scss:

    mv app/assets/stylesheets/application.css app/assets/stylesheets/application.scss
    
  4. Delete all Sprockets directives in application.scss (require, require_tree and require_self) and use Sass’s native @import instead (why?).

  5. Import Bourbon at the beginning of application.scss. Any project styles that utilize Bourbon’s features must be imported after Bourbon.

    @import "bourbon";
    @import "home";
    @import "users";
    

Installing with npm and using a Node-based asset pipeline

  1. Add Bourbon as a dependency:

    npm install --save bourbon
    
  2. If you’re using eyeglass, skip to Step 3. Otherwise, you’ll need to add Bourbon to your node-sass includePaths option. require("bourbon").includePaths is an array of directories that you should pass to node-sass. How you do this depends on how node-sass is integrated into your project.

  3. Import Bourbon into your Sass files:

    @import "bourbon";
    

Installing older versions of Bourbon

  1. Uninstall any Bourbon gem versions you already have:

    gem uninstall bourbon
    
  2. Reinstall the Bourbon gem, using the -v flag to specify the version you need:

    gem install bourbon -v 4.2.7
    
  3. Follow the instructions above to install Bourbon into your project.

Command Line Interface

bourbon [options]

Options

OptionDescription
-h, --helpShow help
-v, --versionShow the version number
--pathSpecify a custom path
--forceForce install (overwrite)

Commands

CommandDescription
bourbon installInstall Bourbon into the current directory
bourbon updateOverwrite and update Bourbon in the current directory
bourbon helpShow help

Browser Support

Bourbon supports Internet Explorer 11+ and the latest versions of Chrome, Firefox, Safari, and Edge.

Contributing

See the contributing document. Thank you, contributors!

License

Bourbon is copyright © 2011 thoughtbot, inc. It is free software, and may be redistributed under the terms specified in the license.

<!-- START /templates/footer.md -->

About thoughtbot

thoughtbot

This repo is maintained and funded by thoughtbot, inc. The names and logos for thoughtbot are trademarks of thoughtbot, inc.

We love open source software! See our other projects. We are available for hire.

<!-- END /templates/footer.md -->