What are best practices organizing css for the Asset Pipeline in Rails 4 -
what best practices organizing css asset pipeline in rails 4? want able share color variables among files, , want control in order scss files fired. better not use manifest syntax, rename application.css application.css.scss , use imports instead?
this how i've structure folder
assets/stylesheet: --application.css --colors.css.scss --fonts.css.scss --frameworks.css.scss --layout.css.scss --nav.css.scss
and application.css file looks this:
*= require_self *= require frameworks *= require fonts *= require colors *= require layout *= require_tree .
and example fonts.css.scss looks this:
@import url(//fonts.googleapis.com/css?family=raleway:400,700,800,900); @import url(//fonts.googleapis.com/css?family=merriweather:400,900,700);
to use custom variables, @import
solution.
i don't use assets pipeline default require
in sass project. instead use @import
.
//application.css.scss @import "my_variables"; @import "bootstrap"; @import "others";
Comments
Post a Comment