Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

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.

like image 975
Rob Avatar asked Mar 18 '16 02:03

Rob


People also ask

Can I use Bootstrap with SCSS?

In your custom. scss , you'll import Bootstrap's source Sass files. You have two options: include all of Bootstrap, or pick the parts you need. We encourage the latter, though be aware there are some requirements and dependencies across our components.

What is Bootstrap Sass gem?

bootstrap-sass is a Sass-powered version of Bootstrap 3, ready to drop right into your Sass powered applications.

Where is Bootstrap SCSS?

After downloading Bootstrap, and the Sass compiler, in the node-modules directory, there is a folder named bootstrap . There are also three folders inside it: dist , js , and scss . All the compiled CSS is in dist , the Bootstrap JavaScript code in js , and all the Sass files are in the scss folder.


1 Answers

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";
like image 162
dp7 Avatar answered Sep 29 '22 04:09

dp7