@each指令中的sass脚本变量

时间:2013-11-06 13:51:15

标签: sass

我的scss文件中有这段代码:

$ttk-bg-green: #99FF00;
$ttk-bg-orange: #FFBE00;
$ttk-bg-purple: #CD66FF;
$ttk-bg-blue: #55BBFF;

$ttk-icon-green: #80D500;
$ttk-icon-orange: #FFAF37;
$ttk-icon-purple: #CD66FF;
$ttk-icon-blue: #62C0FF;
$color-types: "bg" "icon";
$color-styles: "green" "orange" "purple" "blue";
@each $color-type in $color-types {
  @each $color-style in $color-styles {
    .ttk-#{$color-type}-#{$color-style} { color: $ttk-#{$color-type}-#{$color-style}; }
  }
}

它应该产生以下内容: .ttk-bg-green:#99FF00;

罗盘编译器无法编译代码,说$ ttk变量不存在 它只是没有把它识别为一个整体变量 想法?溶液

0 个答案:

没有答案