我想在SASS中动态创建mixins,以列表中的每个项目命名,但似乎不起作用。如何在SASS中定义动态混音或函数名称?
我试过,但我得到一个错误:
$event-icons: fair, concert, art-show, conference, dance-show, film, party, festival, theatre, launch
@each $event-icon in $event-icons
@mixin event-icon-#{$event-icon}
background-position: -($event-icon-width * $i) 0
错误:
Invalid CSS after "": expected expression (e.g. 1px, bold), was "#{$event-icon}"
这是使用不支持SASS?我在手册中找不到关于它的任何内容。
你确定在这种情况下你需要使用'@ mixin'吗?在 –