Make backward nesting in scss?

后端 未结 2 1705
梦如初夏
梦如初夏 2020-12-07 00:13

Is there a way to nest backwards in scss? In css when I want to override style becourse of IE or other browser specific styles I like the selector to be rig

相关标签:
2条回答
  • 2020-12-07 00:46

    You're looking for the & parent selector.

    .class-a{
      .class-b { 
        color: pink;
        .ie7 & {
          color: blue;
        }
      }
      .othercss { bla bla bla: sdfsd }
      .fsdfsd { dfsdfs: sdfsd }
    }
    

    http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#referencing_parent_selectors_

    0 讨论(0)
  • 2020-12-07 00:47

    I haven't found this possible, no.

    On a side note if you need to add too many styles addressed directly to IE7+8 etc. there's most likely a better cross-browser way to do it, I haven't found it to be a problem having to do a few old IE specific nesting trees in my projects so far.

    0 讨论(0)
提交回复
热议问题