Skip to content

[css-2023] Add !important tiers, such as !important-1, !important-10 like z-indexes #9106

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

Closed
alexluongfm opened this issue Jul 24, 2023 · 2 comments

Comments

@alexluongfm
Copy link

alexluongfm commented Jul 24, 2023

Add !important tiers to easily allow overriding higher level css with local changes. Where !important would default to !important-1 and higher tiers override lower ones just like z indexes.

More of a quality of life/making life easier change.

@cdoublev
Copy link
Collaborator

Don't you think that !important is often considered as a "code smell" that can now be avoided with @layer and @scope? And you can still increase the specificity of the selector whose declaration should be more important.

@tabatkins
Copy link
Member

!important, in general, shouldn't be heavily used. The @layer rule is the intended way to handle the sort of specificity conflicts that caused people to overuse !important in the past.

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

3 participants