K
K
Kirill2021-03-04 14:01:42
React
Kirill, 2021-03-04 14:01:42

How in css modules in one file will refer to the class of another file?

Standard task: there is a menu item, when you hover over it, another menu should open. the menu item and the other menu are in different components.

With normal css/scss the solution would be:

.first-component__item:hover {
 .second-component {...}
}


But in css modules, this by itself will not work because of the hash. I read the Doc, I either did not find a similar example or did not understand it. I will be grateful for any help.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question