gajus / gajus/babel-plugin-react-css-modules
SASS @at-root generated class names do not work with plugin
- Lenguaje dominante
- JavaScript
- Estrellas
- 2k
- Forks
- 159
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
When using SASS `@at-root` directive and referencing the parent class name with `#{&}`, the babel plugin is unable to find a class, but the class exists at runtime. Below is the error I'm getting, here is the basic setup:
```scss
.ResultWrapperHeader {
...
@at-root #{&}__title {
...
}
}
```
Which outputs to:
```css
.ResultWrapperHeader {...}
.ResultWrapperHeader__title {...}
```
The plugin gives me this error message: `Could not resolve the styleName 'ResultWrapperHeader__title'.`
This may just be something that is not supported with the babel plugin version, since the plugin would have to process the sass to css in order to know what the class name is. Is there a way around this issue and still use this nested pattern (other than not using nesting)?
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Línea de trabajo
Comienza reproduciendo el fragmento de Sass y el error del babel plugin descritos en el issue. Sigue la resolución del nombre de clase por parte del plugin para la clase generada ResultWrapperHeader__title; se considera terminado cuando la clase generada válida se resuelve sin el error indicado.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- babel, javascript, react, sass
- Área
- frontend, tooling
- Tipo de issue
- Error
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 35/100