Andarist / Andarist/stylis-plugin-extra-scope

v0.3.0 does not work with nested ampersand

未關閉
#15 2 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
JavaScript
星號
23
分支
14
PR 合併指標
30 天內沒有已合併 PR

描述

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;}` ✅

貢獻指南

這個儲存庫沒有索引到貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。