Add "Why do my DOM nodes have two classes?" to the FAQ
See original GitHub issueThis is copied from a recent chat log, we should clean this up and add it to the FAQ:
The first class (
sc-bfhe32
) is static per-component, meaning every instance of a<Button />
will have that class. The second is per-dynamic-stylr-fragmet, so all<Button primary />
will have the same one, all<Button secodary />
will have the same one etc. Note that the first one doesn’t actually have any styles attached to it because it’s only used for when you interpolate the component (${Button}
) and so that in the DevTools you can quickly tweak allButton
s no matter if they’re primary, secondary or whatever else
Issue Analytics
- State:
- Created 6 years ago
- Comments:10 (10 by maintainers)
Top Results From Across the Web
Document Object Model FAQ - W3C
Why do I get adjacent Text nodes? Changing CDATA sections into Text nodes; Why are the DOM APIs "interfaces" rather than "classes"? Why...
Read more >CSS FAQ - Learn web development | MDN
How do I assign multiple classes to an element? HTML elements can be assigned multiple classes by listing the classes in the class...
Read more >How to add a class to DOM element in JavaScript?
In DOM, all HTML elements are defined as objects. ... It has a method called “add” which is used to add class name...
Read more >How To Modify Attributes, Classes, and Styles in the DOM
In this tutorial, we will learn how to further alter the DOM by modifying styles, classes, and other attributes of HTML element nodes....
Read more >How to Manipulate the DOM - the Ultimate Beginner's Guide
Once you have selected an element, you can add styles to the element, manipulate its attributes, and traverse to parent and child elements....
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
Wow that would be an amazing addition! We’ve had to answer this too many times 😃
I could give this a go as my first contribution! Just to clarify, I’m supposed to make a new question in the FAQ explaining this in a good way and using an example?