Sass:@at-root
Posted keep
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Sass:@at-root相关的知识,希望对你有一定的参考价值。
@at-root 从字面上解释就是跳出根元素。当你选择器嵌套多层之后,想让某个选择器跳出,此时就可以使用 @at-root。来看一个简单的示例:
.a { color: red; .b { color: orange; .c { color: yellow; @at-root .d { color: green; } } } }
编译出来的CSS
.a { color: red; } .a .b { color: orange; } .a .b .c { color: yellow; } .d { color: green; }
以上是关于Sass:@at-root的主要内容,如果未能解决你的问题,请参考以下文章