静态导入scss变量

时间:2014-09-10 04:45:26

标签: sass compass-sass

我在_variables.scss中定义了一堆变量。我不想导入整个文件,因为它有一些依赖项。我只想将该文件中的一个变量导入另一个scss文件。

有可能吗?

使用案例

我有两套scss文件。两者都有独立的编译流程。对于一组,我在_variables.scss中定义了一堆所需的变量。我需要所有这些变量来编译第一组scss文件。 现在有第二组scss文件,它们只需要很少的上面定义的变量。目前,我将这几个变量复制到_variables2.scss并导入它。

1 个答案:

答案 0 :(得分:0)

你可以这样做:

_shared_variables.scss:

// shared variables here

_variables_one.scss

@import "_shared_variables";
// all variables unique to the first sass file here

sass_one.scss

@import "_variables_one.scss";
// other sass one scss here

sass_two.scss

@import "_shared_scss";
// other sass two scss here
相关问题