只是寻找任何最佳做法/提示。感谢。
答案 0 :(得分:1)
&
字符将允许您在声明中引用父选择器。例如:
a {
font-weight: bold;
text-decoration: none;
&:hover { text-decoration: underline; }
body.firefox & { font-weight: normal; }
}
编译为:
a {
font-weight: bold;
text-decoration: none; }
a:hover {
text-decoration: underline; }
body.firefox a {
font-weight: normal; }
来源:http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#referencing_parent_selectors_