Extending Bootstrap default look in a Rails project

in #utopian-io6 years ago


There is a new way of customizing your styling in Bootstrap 4. You can import the particular Bootstrap component you would want to modify. I normally find myself modifying colors in most of my Rails Projects.

@import '/bootstrap/_variables.scss'   // The source of my Bootstrap
  // Colour Scheme
  $primary:   #1a284d  // My primary colour
  $secondary: #1eff23  // My Secondary colour 

Then I allow the bootstrap gem and sass-rail gem to make the compilation for me.

`Gem file`
...
  # Bootstrap Gem for my HTML framework
  gem 'bootstrap', '~> 4.1.1'
  # Use SCSS for stylesheets
  gem 'sass-rails', '~> 5.0'
...