Sass, Compass, compile all CSS file to one [duplicate]

大憨熊 提交于 2020-01-20 03:25:07

问题


Now, while I am developing my project I have three files, "main.css", "about.css" and "news.css" (for example). Is it possible to compile them into one "final.css" for production?


回答1:


The SASS import directive is used to import the contents of one file into another, so you could create a file final.scss whose contents are:

@import 'main';
@import 'about';
@import 'news';

You'd then need to rename your files to have "scss" extensions so the import directive will find them. If you don't want the main.scss, about.scss, and news.scss files to compile to CSS files themselves, you can use partials by prefixing the filenames with an underscore (i.e., _main.scss, _about.scss, _news.scss).



来源:https://stackoverflow.com/questions/13025865/sass-compass-compile-all-css-file-to-one

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!