menu

Gem Installation

Add this line to your application's Gemfile:

gem "n2_styles", git: "git@github.com:n2publishing/n2-styles"

And then execute:

$ bundle

Configure overrides as needed:

$ bin/rails generate n2_styles:install

Add to application.css:

/*
 *= require n2_styles/all
 */

Add to application.js:

//= require n2_styles

Add 'n2-styles' class to html tag:

%html.n2-styles

How can I run this alongside an old version of bootstrap?

Instead of having an application.css file, opt for having an application.scss file that way we can leverage sass to namespace the styles for us.

@import "//fonts.googleapis.com/icon?family=Material+Icons";
@import "n2_styles/namespace";
.n2-styles {
  @import "n2_styles";
}

Instead of using the 'n2-styles' class on the html tag, apply the 'n2-styles' class to the parent of the component desired.