31 May '16, 12am

Sass Pathways

Sass’s killer feature was truly the @import statement. When a Sass file is imported, all the variables and mixins defined previously are now available in any subsequent imported file. So, it is very good practice to define a single top-level stylesheet that you link to from the <HEAD> of your page layout. In a Rails implementation, this would likely be the application.scss . This root file is then compiled into a CSS file of the same name. This file and its subsequent imported partials I refer to as a pathway. Although most sites do not require it, you may have more than one pathway. There are several reasons for this, but they are often one of these: An “admin” view with a different design from the main site A live style guide with all of its extra CSS used to present the guide itself A new design in progress, with a corresponding separate layout A new pathway with refact...

Full article: https://robots.thoughtbot.com/sass-pathways