指南针和sass:可以自动导入所有局部声吗? [英] Compass and sass: possible to auto-import all partials?
问题描述
在罗盘/无源设置中,理想情况下,我想将每个.scss文件编译成一个大的 style.css
。看起来例如此处,看来我唯一的选择是将 _partials.scss
和 @import these制成;
来自一个主文件。这似乎是双重工作,因为每次我在.scss文件中移动时,例如到子文件夹中,我必须更新引用的导入路径。
In a compass/sass setup, ideally I would like to compile every .scss-file into one big style.css
. Looking e.g. here, it seems my only option would be to make _partials.scss
and @import "these";
from one main file. This seems like double work, since every time I move around a .scss-file e.g. to a sub folder I have to update the referenced import-path.
我的问题是:是否可以用罗盘代替而只看一个文件夹并始终将所有部分编译为一个目标输出文件?
My question is: is it possible with compass instead to just watch a folder and always compile all partials into one single target output file?
推荐答案
使用 Sass Globbing插件。
通过这种方式,您可以导入整个文件夹:
This way you can import an entire folder:
@import "library/partials/*"
部分将在导入之前按字母顺序排序。
The partials will be sorted alphabetically before being imported.
这篇关于指南针和sass:可以自动导入所有局部声吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!