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

!important declaration is not being respected #28

Closed
yuheiy opened this issue Apr 17, 2024 · 2 comments · Fixed by #29
Closed

!important declaration is not being respected #28

yuheiy opened this issue Apr 17, 2024 · 2 comments · Fixed by #29

Comments

@yuheiy
Copy link
Contributor

yuheiy commented Apr 17, 2024

When I include the !important declaration in a property value, it gets removed during the processing. Below is the CSS where this issue occurs:

section {
  background: light-dark(white, black) !important;
}

will be processed to:

@media (prefers-color-scheme:dark) {
    :where(html:not(.is-light)) section {
        background: black
    }
}
:where(html.is-dark) section {
    background: black
}
@media (prefers-color-scheme:light) {
    :where(html:not(.is-dark)) section {
        background: white
    }
}
:where(html.is-light) section {
    background: white
}

I believe the !important declaration should be preserved after transformation to ensure the intended styles remain prioritized.

@ai
Copy link
Member

ai commented Apr 17, 2024

Sure. Can you send PR? I am busy on another project right now.

@yuheiy
Copy link
Contributor Author

yuheiy commented Apr 17, 2024

OK. I will give it a try when I have some free time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants