Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract style_rule inside a media query #17

Closed
stoivo opened this issue May 22, 2024 · 3 comments
Closed

Extract style_rule inside a media query #17

stoivo opened this issue May 22, 2024 · 3 comments

Comments

@stoivo
Copy link
Contributor

stoivo commented May 22, 2024

I created one issue where I asked why I don't get rules, #15 (comment). I did a bit more research on my own and think there is a bug here. I was reading the documentation on Consume an at-rule, and then we consume { we should "Consume a block from input, and assign the result to rule’s child rules" which meam we should extract rules

@stoivo
Copy link
Contributor Author

stoivo commented May 22, 2024

I created a small tool for me to work around this for my need but I think media queries can have declaration directly inside like

  body {
    background-color: black;
    color: white;
    @media screen and (prefers-color-scheme: light) {
      background-color: white;
      color: black;
    }
  }

  body {
    background-color: black;
    color: white;
  }
  @media screen and (prefers-color-scheme: light) {
    body {
      background-color: white;
      color: black;
    }
  }

These two blocks does the same. Maybe they are a new standard to might still be buggy

@stoivo stoivo closed this as completed May 22, 2024
@stoivo stoivo reopened this May 22, 2024
@stoivo
Copy link
Contributor Author

stoivo commented May 22, 2024

in (2013 documentation -> 5.1 Parser Railroad Diagrams)[https://www.w3.org/TR/2013/WD-css-syntax-3-20130919/#parser-diagrams] the spec for At-rule only refers to a block, and a block only has Component value. Also Qualified rule also only have a block even those er parse it with declarations.

in 2021 edition the block is the same, but in 2024 draft 22.april edition the block is more advanced

@rgrove
Copy link
Owner

rgrove commented May 22, 2024

I don't think there's a bug here because Crass currently implements the 14 November 2014 editor's draft of CSS Syntax Level 3, and I believe this is the behavior it defines. However, you're correct the the latest drafts have introduced significant changes.

Issue #14 already tracks the desire to add support for nesting (which was the reason for most of the spec changes), so I think that's probably the best place for any further discussion. I did some exploratory work on this a while back — enough to determine that the necessary changes won't be trivial — but I haven't had time to go further.

@rgrove rgrove closed this as not planned Won't fix, can't repro, duplicate, stale May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants