简体   繁体   English

(SASS)如何排除导入的文件以编译为CSS文件

[英](SASS) How do I exclude my imported files to compile to css files

I have the following sass directory 我有以下sass目录

sass ass

config.rb
-base.scss
-mixins.scss
-main.scss 

site
  -dowmloads.scss
  -messages.scss
  ...
  ...

This works fine, however I don't want all my .scss files to compile to css files.I just want to output main.css because it imports the other files. 这个工作正常,但是我不希望所有的.scss文件都编译为css文件,我只想输出main.css,因为它会导入其他文件。 Whenever I do compass watch all the css get created... Is this possible? 每当我做指南针时,所有css都会被创建...这可能吗?


Start the filename with an underscore. 用下划线开始文件名。 You can then import this and it's styles will only get added to the file that imports it. 然后,您可以导入它,它的样式只会添加到导入它的文件中。 The actual file itself will never get generated into it's own css file. 实际文件本身永远不会生成到其自己的CSS文件中。

Hope it helps. 希望能帮助到你。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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