question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add "Why do my DOM nodes have two classes?" to the FAQ

See original GitHub issue

This 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 all Buttons no matter if they’re primary, secondary or whatever else

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
kittencommented, Oct 25, 2017

Wow that would be an amazing addition! We’ve had to answer this too many times 😃

2reactions
nilsgoksorcommented, Oct 24, 2017

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?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found