ruby-on-railsruby-on-rails-4rubygemsbootstrap-sass

For installing bootstrap-sass gem do I remove *= require_self from application.scss or replace it with import '@require_self'


I'm installing the bootstrap-sass gem and this line to do with application.scss confuses me.

'Then, remove all the *= require_self and *= require_tree . statements from the sass file. Instead, use @import to import Sass files.'

Do I remove *= require_self and *= require_tree . and replace them with import '@require_self' and import '@require_tree .' or just remove them.

Also for any other imported files inside application.scss like

 *= require dataTables/jquery.dataTables
 *= require froala/froala_editor.min.css

should I change them to

 @import 'dataTables/jquery.dataTables'
 @import 'froala/froala_editor.min.css'

Just confused and would like a confirmation on what to do here.


Solution

  • While using bootstrap-sass,remove everything from your application.scss and instead add the followings to it:

    #"bootstrap-sprockets" must be imported before "bootstrap" and "bootstrap/variables"
    @import "bootstrap-sprockets";
    @import "bootstrap";
    

    If you wish to load additional scss/sass files then, you can @import them to application.scss
    If you wish to load css files then, you can *= require them like the followings:

    /*
    *= require_self
    *= require your_css_file
    */
    @import "bootstrap-sprockets";
    @import "bootstrap";