Re: [csswg-drafts] [css-nesting] request to pick up the css-nesting proposal

You're right @LeaVerou, I should have made a more productive comment, but honestly felt that @tabatkins already covered most of the "issues" I have with this feature. To be more specific: (a) privileges the descendant combinator, (b) could be used just for the cosmetic reasons —i.e. to increase readability, which is arguable depending on the size of the parent rule— and increase specificity unnecessarily, (c) many people thinks that nesting is the "right way" to use a preprocessor/transpiler, (d) many people tends to think that nesting should be used to replicate the DOM structure. I have done far so many code reviews and talk with so many devs that made this mistakes over and over that, to be honest, I have grown a sentiment of dislike for this feature. I understand it has more to do with less experienced devs using it for the wrong reasons that for a problem with the feature itself. 

Thank you very much @jonathantneal, you interpreted my concerns perfectly.

> However, these selectors would not be technically worse than what one can already do by writing out long, complex CSS selectors.

I agree. But with nesting writing "bad selectors" it's easier and "feels" less bad.

This will probably not raise many concerns:

```scss
.foo {
  /* .. */
  & .bar {
    /* .. */
    & .baz {
      /* .. */
    }
  }

  & .qux {
    /* .. */
    & .quz {
      /* .. */
    }
  }
}
```

This will probably be called out in a code review:

```scss
.foo {
  /* .. */
}
.foo .bar {
  /* .. */
}
.foo .bar .baz {
  /* .. */
}
.foo .qux {
  /* .. */
}
.foo .qux .quz {
  /* .. */
}
```

Again, my reasons are totally subjective and I don't think that the feature itself is bad —to be really honest I don't find it useful since I tend to "nest" in very rare occasions— rather that it could be easily abused and misused —at least in my experience.



Hope this adds to the conversation. 😀 

-- 
GitHub Notification of comment by battaglr
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/2701#issuecomment-397147233 using your GitHub account

Received on Thursday, 14 June 2018 02:25:48 UTC