使用SASS&Compass,您是否仍然可以以缩进的后代方式编写,但添加一个规则/命令,以便将给定的后代写入另一个级别(例如根)?
因此:
#example-id-1 {
background: blue:
#example-id-2 {
background: red:
#example-id-3 {
background: yellow:
}
}
}
通常会输出以下内容:
#example-id-1 { background: blue: }
#example-id-1 #example-id-2 { background: red: }
#example-id-1 #example-id-2 #example-id-3 { background: yellow: }
但规则是否适用于
#example-id-2
或
#example-id-3
使得输出变为:
#example-id-1 { background: blue: }
#example-id-2 { background: red: }
#example-id-3 { background: yellow: }
非常感谢