Andarist / Andarist/stylis-plugin-extra-scope

v0.3.0 does not work with nested ampersand

Aperta
#15 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
JavaScript
Stelle
23
Fork
14
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Hello, I'm not 100% sure if this is an issue or something I am doing wrong, but I noticed upgrading to v0.3.0 changed the css in some snapshots like so:
```
- #modal-root [aria-expanded='true'] .emotion-21::-webkit-input-placeholder {
- color: #fff;
+ [aria-expanded='true'] #modal-root .emotion-21::-webkit-input-placeholder {
+ color: #fff;
}
```

I reproduced the issue here (note stylis is still v3 in this, I see v4 isn't supported yet): https://codesandbox.io/s/elated-satoshi-85mlt

Reproduction code in case sandbox becomes inaccessible for some reason:
```
const stylis = new Stylis();
stylis.use(extraScopePlugin("#my-scope"));

const rules = stylis(
".emotion-1",
`
[aria-expanded='true'] & {
color: blue;
}
`
);
```

Resulting `rules`:
- v0.3.0: `[aria-expanded='true'] #my-scope .emotion-1{color:blue;}` ❌
- v0.2.1: `#my-scope [aria-expanded='true'] .emotion-1{color:blue;}` ✅

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.