Add "How can I override styles with higher specificity?" to FAQ
See original GitHub issueSince this question comes up almost every day in the main repo, we should add a FAQ entry to the website.
Based on this question and answer we should add a note about the &&&
workaround and why it works to the FAQ.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:4
- Comments:13 (8 by maintainers)
Top Results From Across the Web
Specificity - CSS: Cascading Style Sheets - MDN Web Docs
The only way to override inline styles is by using !important . Many JavaScript frameworks and libraries add inline styles. Using !important ...
Read more >How to override styles with higher specificity - Stack Overflow
I need to override some class in my div. So my structure looks like this: How Can I achieve this with higher specificity...
Read more >How to Override CSS Styles - W3docs
How CSS overriding works, what is the cascading order and inheritance, what are the priorities and some tricks to override them.
Read more >Strategies for Keeping CSS Specificity Low
A rather forceful way to handle an override is use an existing wrapping element over the area you need to apply style overrides...
Read more >Importance of CSS Specificity and its best practices
Selectors used inside pseudo classes like :not() with highest specificity will be the specificity. Child or sibling selectors ( >, ~, + )...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The ampersand solution is for overriding styles applied with former classNames or styled applied from the parent and some other cases. It’s not meant to be used for overriding inline styles.
You can use as many
&
as you want, the more you use the higher the specificity will be!