Content-Length: 321330 | pFad | https://github.com/w3c/csswg-drafts/issues/8738

F7 [css-cascade] [css-nesting] Figure out whether we're fine with "shifting up" bare declarations after rules · Issue #8738 · w3c/csswg-drafts · GitHub
Skip to content

[css-cascade] [css-nesting] Figure out whether we're fine with "shifting up" bare declarations after rules #8738

@emilio

Description

@emilio

If you do:

div {
  color: green;
  @media (width > 0) {
    color: red;
    background: red;
  }
  background: green;
}

My understanding is that per spec the div color and background would be red.

That seems rather confusing. There are various alternatives here:

  • We're ok with this.
  • We forbid declarations after nested rules.
  • We deal with bare declarations by somehow sorting them together, so that would be effectively something like:
div {
  color: green;
  @media (width > 0) {
    color: red;
    background: red;
  }
  & {
    background: green
  }
}

Maybe something else?

cc @fantasai

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    unsorted FTF

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions









      ApplySandwichStrip

      pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


      --- a PPN by Garber Painting Akron. With Image Size Reduction included!

      Fetched URL: https://github.com/w3c/csswg-drafts/issues/8738

      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy