gajus / gajus/babel-plugin-react-css-modules

SASS @at-root generated class names do not work with plugin

Aperta
#81 8 commenti 2 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
JavaScript
Stelle
2k
Fork
159
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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)?

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.