HTML & CSS · Middle · Question 37 of 75

How do CSS Modules solve class-name collisions?

Explanation

The .title class from Card.module.css becomes something like Card_title__x7a2b, and the component imports a mapping object. Collisions disappear without naming conventions. Global styles use :global. Shadow DOM is a Web Components mechanism; CSS Modules don't use it.

Further reading

Problem with a question

HTML & CSS · Middle · question 37

Test yourself

Take the HTML & CSS · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz