There is create-react-app (react 17), eject is executed to access the configs, there is the scss module index.module.scss and it uses the $white variable from the colors.scss file with colors. The module is isolated and there is no access to the variable. The only solution I found was to turn colors.scss into a module and import it into every scss file that uses color value variables. Is there a way to make these scss variables available to all files without doing this copying?
//colors.module.scss
$ white: #ffffff;
// index.module.scss
@import "~ scss/colors.module";
.wrapper {
background-color: $white;
}
I found an old solution here, this is one to one my situation, only in React, but I could not write it in the config so that it worked (if I understood correctly, in ./config/webpack.config.js), maybe someone can help with this