CRITICAL: in development, CSS modules class names are not scoped and collide between sources of the same folder #5018
Labels
bug
An error in the Docusaurus core causing instability or issues with its execution
🐛 Bug Report
Prerequisites
npm run clear
oryarn clear
command.rm -rf node_modules yarn.lock package-lock.json
and re-installing packages.Description
In development, CSS modules class names are not scoped and collide between sources of the same folder
Have you read the Contributing Guidelines on issues?
Yes.
Steps to reproduce
.root
rule with a discernible background color.root
class in each of these component and apply the style to the top element returned by this component.Expected behavior
Each of these components background should be distinct, because each component should have a unique class name.
Actual behavior
Each of these components has the same background color, because each component has the same class name (e.g.
root_src-components-
. It looks like the method to extract a unique class name is missing the file name.Your environment
Reproducible demo
https://codesandbox.io/s/docusaurus-css-collision-5xqmy?file=/src/pages/index.js
Remarks: I haven't tried to assess if this issue also happens in production yet.
The text was updated successfully, but these errors were encountered: