SASS更改嵌套元素类的命名风格 [英] SASS change nested elements class naming style
本文介绍了SASS更改嵌套元素类的命名风格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想使用带有SASS的SMACSS命名系统。
预期以下SASS代码:
I'd like to use SMACSS naming system with SASS. Expect following SASS code:
nav
ul
margin: 0
padding: 0
list-style: none
>
as output i'll get
nav ul {
margin: 0;
padding: 0;
list-style: none;
}
但根据SMACSS方法类命名应该看起来像这样:
but according to the SMACSS methodology class naming should looks like this:
nav-ul {
margin: 0;
padding: 0;
list-style: none;
}
您能否请教如何在SASS中更改类命名风格以达到此目标
Could you please advice how to change class naming style in SASS to reach this goal?
推荐答案
您可以这样写:
nav
&-ul
margin: 0
padding: 0
list-style: none
结果:
nav-ul {
margin: 0;
padding: 0;
list-style: none;
}
这篇关于SASS更改嵌套元素类的命名风格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文