How bad is it in practice to over-nest selectors in SASS/SCSS?

前端 未结 6 2085
情话喂你
情话喂你 2020-12-30 02:25

I have a .scss file that, among other things contains this:

nav {
  font-size: 0;
  ul {
    margin: $padding/3;
  }
  li {
    z-index: 10;
    position: re         


        
6条回答
  •  天涯浪人
    2020-12-30 03:20

    Although not directly an answer to your question, you can keep highly nested sass for your own purposes but still use @at-root. Check it out here.

    .parent {
      @at-root {
       .child1 { ... }
       .child2 { ... }
      }
    } 
    
    // compiles to ... 
    
    .child1 { ... }
    .child2 { ... }
    

提交回复
热议问题