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.

More meaningful/semantic class names during development

See original GitHub issue

Currently all generated class names look like this:

image

And it really causes problems while debugging. I do not understand where I am. Well of course I can switch between react devtools and inspector – but it does not make it more convenient.

Is it possible to use class names similar to styled components names. Maybe with random prefix like:

const Wrapper = styled.div`
  background: red;
`;

and the class name will be like .frh743-Wrapper or smth like this.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:24
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

17reactions
kittencommented, Jul 7, 2017

Yes, you can use the babel plugin to attach the displayName to the component’s class https://github.com/styled-components/babel-plugin-styled-components

11reactions
CMCDragonkaicommented, May 17, 2019

What about using that in a type script environment?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Semantic Class Naming - Ukiah Smith
Semantic class naming is a style in which we use class names that describe what an element is, or it's intended purpose, rather...
Read more >
What Makes For a Semantic Class Name? | CSS-Tricks
“Semantic” class or ID names give zero benefits to users. They only affect developers, and developers should choose whatever works best for ...
Read more >
Use class with semantics in mind - Quality Web Tips - W3C
Use class with semantics in mind. Often people use class names like bluetext , or redborder . A much better way to name...
Read more >
Semantic class names: are you being too generic? - Medium
Most developers choose generic class names. In theory, this is a good because the more generic the class name, the more reusable it...
Read more >
How to semantically name your classes - CoffeeCup Software
Semantic class names should not be too narrow, but not too broad either. Somewhere right in the middle, the sweetspot! During our research...
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