mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Add note about how Sass & Sprockets don't match
This commit is contained in:
parent
9de9f6b4d0
commit
da773a24be
1 changed files with 3 additions and 1 deletions
|
@ -19,7 +19,7 @@ Prior to Rails 3.1 these features were added through third-party Ruby libraries
|
|||
|
||||
By having this as a core feature of Rails, all developers can benefit from the power of having their assets pre-processed, compressed and minified by one central library, Sprockets. This is part of Rails' "fast by default" strategy as outlined by DHH in his keynote at RailsConf 2011.
|
||||
|
||||
In Rails 3.1, the asset pipeline is enabled by default. It can be disabled in +config/application.rb+ by putting this line inside the application class definition:
|
||||
In Rails 3.1, the asset pipeline is enabled by default. It can be disabled in +config/application.rb+ by publicing this line inside the application class definition:
|
||||
|
||||
<ruby>
|
||||
config.assets.enabled = false
|
||||
|
@ -234,6 +234,8 @@ The directives that work in the JavaScript files also work in stylesheets, obvio
|
|||
|
||||
In this example +require_self+ is used. This puts the CSS contained within the file (if any) at the precise location of the +require_self+ call. If +require_self+ is called more than once, only the last call is respected.
|
||||
|
||||
NOTE. If you want to use multiple Sass files, use the "Sass +@import+ rule":http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#import instead of the Sprockets directives. Using Sprockets directives all Sass files exist within their own scope, making variables or mixins only available within the document they were defined in.
|
||||
|
||||
You can have as many manifest files as you need. For example the +admin.css+ and +admin.js+ manifest could contain the JS and CSS files that are used for the admin section of an application.
|
||||
|
||||
The same remarks about ordering made above apply. In particular, you can specify individual files and they are compiled in the order specified:
|
||||
|
|
Loading…
Reference in a new issue