Skip to content

[css-nesting] Allow CSS nesting for inline styles #8752

Open
@miragecraft

Description

@miragecraft

Whether CSS nesting works for inline styles isn't actually defined in the specs, as far as I can find.

So I was under the assumption that I could do:

<ul style="
   & a {
    font-weight:bold;
    &:link {color:green}
    &:is(:hover, :active) {color:red} 
  }">
  <li><a href="#">Home</a></li>
  <li><a href="#">Blog</a></li>
  <li><a href="#">About</a></li>
 </ul>

And found out that no, it doesn't work.

I'm hoping that this behaviour can be defined at the very least, and allowed if at all possible.

By allowing nesting to work with inline styles, it creates a very useful method to scope CSS styles.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions