Re: [csswg-drafts] [css-nesting]The parent selector should not be placed inside the subselector (#2909)

(Not sure if i post it in the good place. And sorry for my poor english)

It maybe less powerfull than your proposal.
I just discovered the "nest" proposal.
And i probably don't have all optimisation in mind too.
But i trust it could be more simple and easy to maintain if we just have something like that (at least in a first time).
(idea from https://github.com/flavi1/lcss)

Example
=======

Just transform this :
```
@(#parent1) {
  @(.sub1.myClass > span, .sub2.active) {
    body { color: #888; }
    @media print {
      body { color: #333; }
    }
  }
  @(.sub3) {
    code { color: red; }
  }
  code { color: blue; }
}

@(#parent) {
  .sous-style {
    display: none;
  }
}
```

To this :

```
#parent1 .sub1.myClass > span body, #parent1  .sub2.active body {
 color: #888; 
}

@media print {
#parent1 .sub1.myClass > span body, #parent1  .sub2.active body {
 color: #333; 
}


}

#parent1 .sub3 code {
 color: red; 
}

#parent1 code {
 color: blue; 
}

#parent .sous-style {
    display: none;
}

```

Think about playing with 
* css files importations "@import" 
* default variables value  "var(--my-var, defalut_val)"
* and assignement in a highter level "--my-var: assigned_val;"
And imagine all you can do with it...

https://github.com/flavi1/lcss

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

Received on Sunday, 27 January 2019 23:07:14 UTC