This project and the Bourbon Sass library source code here are 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.
-
Get the code:
git clone https://github.com/thoughtbot/bourbon.io.git -
Set up your machine:
bin/setup -
Run the app:
bundle exec middlemanopen http://localhost:4567
Bourbon uses SassDoc to document its source code. For this website, we use
a Rake task to run SassDoc’s CLI, which parses documentation-specific comments
from Bourbon’s source and outputs them as versioned JSON files
(e.g. bourbon_5_0_0.json). We then use a proxy in Middleman to generate
unique pages for each version.
SassDoc has only been in use since v5.0.0. The v4 release is documented via a static page, pulled from the previous website.
To generate documentation for a published version of Bourbon,
use the generate_docs_for task:
rake generate_docs_for 5.0.0
The website is hosted on Netlify, and is automatically built and deployed when
changes are pushed to the main branch.
This project uses:
- Sass, with Bourbon
- BEM-style CSS class names, with namespaces
library/: Global variables, mixins and functions; all non-rendering Sassbase/: Unclassed HTML elements (e.g.a {},input {})patterns/: Abstractions, highly reusable pieces of style that are used in any number of unrelated contexts (e.g..p-media {})components/: Discrete, implementation-specific piece of UI (e.g..c-site-nav {})utilities/: High-specificity, very explicit selectors. Overrides and helper classes (e.g..u-flex {}).
- Autoprefixer
- A variety of CSS units:
emfor typographical-related elementsremfor lengths related to componentspxfor borders, text shadows, etc.vw/vhfor lengths that should be relational to the viewport
modular-scale()(which outputsemvalues) for font sizes