我正在使用模板系统,我需要将CSS选择器设置为#%id%。然而,无论我如何欺骗SASS使用该选择器,我都无法使其工作。有没有人对我如何做这项工作有任何想法?SASS与自定义模板选择器
我总是得到这个错误。
Invalid CSS after "#": expected id name, was "%id%"
更新:
这是我曾尝试...
@mixin thing($id) {
##{$id} {
color:red;
}
}
@include thing(unquote('%id%'));
......还有......
$id:'%id%';
##{unquote($id)} {
color:red;
}
...最后。 ..
#%id% {
color:red;
}
显示您尝试过的内容。 – cimmanon
更新了几个方法,我试图让它工作。 –