在scss中使用哈希

哈希 CSS

LGil

2020-04-03

嗨,我有很多颜色变量。所以想做这样的事情:

$culture: #00CC66;
$party:#CC9900;

 @each $i in culture, party {
.bl_#{$i}{
   border-left-color: #{$#{$i}};
}
}

打印:

bl_culture{border-left-color:#00cc66}
bl_party{border-left-color:#cc9900}

我该怎么做?

谢谢

第3907篇《在scss中使用哈希》来自Winter(https://github.com/aiyld/aiyld.github.io)的站点

0个回答

问题类别

JavaScript Ckeditor Python Webpack TypeScript Vue.js React.js ExpressJS KoaJS CSS Node.js HTML Django 单元测试 PHP Asp.net jQuery Bootstrap IOS Android