【发布时间】:2020-02-17 08:33:32
【问题描述】:
如何在 scss 中访问 typescript 变量。我附上了代码。我将不胜感激。
#someselector {
@include somemixin($someargument: $valuefromtypescript);
background:blue;
}
【问题讨论】:
标签: typescript sass
如何在 scss 中访问 typescript 变量。我附上了代码。我将不胜感激。
#someselector {
@include somemixin($someargument: $valuefromtypescript);
background:blue;
}
【问题讨论】:
标签: typescript sass
这是不可能的。 TypeScript 变量在运行时进行评估。 SCSS 在编译期间编译为 CSS。
您唯一能做的就是使用 TypeScript 变量并根据变量值将类附加到 DOM。但这是一种完全不同的方法。
【讨论】: