1

Less 有这个方便的选项,引用的导入文件将仅用于解析变量,但不会被内联。有没有办法对postcss-import或任何其他类似的 PostCSS 插件做同样的事情?

下面的代码块是这种行为在 Less 中的工作方式。我想用 PostCSS 实现类似的行为。

@import (reference) "foo.less";

/* Content of "foo.less" won't be inlined but variables on this different file will be resolved */
.rules {
    width: @big; /* Declared in "foo.less". It will be resolved to 1200px (for example) */
}
4

0 回答 0