[csswg-drafts] [css-nesting-1] Indenting of deeply nested rules is still only one level (#7862)

sesse has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-nesting-1] Indenting of deeply nested rules is still only one level ==
There's an example from the nesting-parsing.html test:

```css
main { & > section, & > article { & > header { color: green; } } }
```
As far as I understand the algorithm (which is defined in https://drafts.csswg.org/cssom-1/#serialize-a-css-rule, I believe—it seems to have been updated for nesting, and then a near-identical copy was pasted into the css-nesting-1 draft for CSSNestingRule), this should be serialized as:

```css
main {
  & > section, & > article {
  & > header { color: green; }
}
}
```

This isn't optimal, by any stretch; not only is it hard to understand the nesting level of the innermost rule, but the second-to-last } also comes at an unexpected place. Could we perhaps have some sort of explicit string replacement? Or idea of nesting level? I don't know how these algorithms are usually defined to be as implementable as possible.

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/7862 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Monday, 10 October 2022 17:40:12 UTC