简体   繁体   中英

Rails asset pipeline priority with css files

如果我有一个home.scss文件(与home.html.erb视图相关联),那么放在那里的CSS是否覆盖了我的application.scss中的CSS,还是application.scss覆盖了资产管道中的任何其他css?

Actually, all the css files in your /assets directory get combined (along with application.css) to make one giant file which is applied to your application. The separate files are there to help you organize your code, but don't actually separate them in any substantive sense.

Between application.css and controller specific css files, the application.css file loads last, overriding whatever duplicate rules you might have specified in a controller specific version.

You actually shouldn't be putting anything other than directives in application.css .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM