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

Utility classes: which classes should have an !important annotation on their declaration? #2284

Open
PolariTOON opened this issue Nov 9, 2022 · 1 comment

Comments

@PolariTOON
Copy link
Contributor

PolariTOON commented Nov 9, 2022

We sometimes use !important to increase the specificity of some declarations made by utility classes. This has the advantage to help us override some styles set by MUI.
Not every utility class annotates its declarations with !important though. We currently have it for dimensions (u-w*, u-h*) but not for some display utility classes for example.
What is the rationale behind putting it on some declarations but not on others? Should we put !important everywhere? Or investigate other ways to increase specificity such as inline styles or @layer rules?

@PolariTOON PolariTOON changed the title Utility classes: which classes should have an annotation on their declaration? Utility classes: which classes should have an !important annotation on their declaration? Nov 9, 2022
@Crash--
Copy link
Contributor

Crash-- commented Nov 15, 2022

Should we put !important everywhere?

Yes. We "cloned" what we have seen in bootstrap. And in bootstrap all utilities are !important. I think that tailwind was also in that case previously but seems to not use important anymore.

If you check the git history, you'll see that we had !important for all our utilities class, it was the main goal : being able to override any style :)

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

No branches or pull requests

2 participants