我在我正在使用的框架的外部文件中定义了这个:
$font-family-sans-serif: "Helvetica Neue", "Roboto", "Segoe UI", sans-serif !default;
我想预备自己的字体(在不同的文件中,例如,不改变FW变量文件)。
$font-family-sans-serif: 'MyFont', $font-family-sans-serif;
那么,有可能吗?以上不起作用。
Error: Undefined variable: "$font-family-sans-serif".
on line 3 of scss/variables.scss
on line 3 of scss/variables.scss
>> $font-family-sans-serif: 'MyFont', $font-family-sans-serif;
答案 0 :(得分:0)
It's valid SASS as long as these files are compiled together. Are you sure that external file with the variable $font-family-sans-serif
has been included before you modify the variable?
Here's your example, but concatenated. It works fine:
$font-family-sans-serif: "Helvetica Neue", "Roboto", "Segoe UI", sans-serif !default;
$font-family-sans-serif: 'MyFont', $font-family-sans-serif;