scss目标多个ID

时间:2018-04-30 13:52:30

标签: css sass

我希望使用scss定位ID中的类,以便我编译的css如下:

#template1 .heroText, #template2 .heroText {
    text-align:center;
}
#template3 .heroText, #template4 .heroText {
    text-align:left;
}

以下scss(以逗号分隔的ID)对我来说似乎不起作用:

#template1, #template2{
    .heroText {
        text-align:center;
    }
}
#template3, #template4{
    .heroText {
        text-align:left;
    }
}

这应该有效还是有不同的方法来定位scss中的多个ID,因为我可以找到的所有文档都与类ID相关

1 个答案:

答案 0 :(得分:0)

感谢您的所有帮助,我将问题跟踪到.sass-cache文件夹。删除后,一旦我对我的scss运行grunt,我编译的css就会按预期显示。