HACKER Q&A
📣 akudha

How do you test React components for CSS?


What is the best way to test React components, specifically CSS? Are there any test frameworks, tricks etc to do it? Is there a way to compare CSS properties of components with Figma designs?


  👤 shakes_mcjunkie Accepted Answer ✓
Are you using vanilla css and class names? Or styling the elements with the style attribute?

Usually if I need to debug css I'll check computed styles in chrome debugger. It will show you what styles are being applied to an element and where they came from [1].

[1] https://support.google.com/webdesigner/answer/9008244?hl=en