cssinjs/jss

[nested] Nested selectors are not calculated properly with `$` in it

開放

#1,321 建立於 2020年3月26日

 (0 則留言) (0 個反應) (0 位負責人)JavaScript (434 個分叉)batch import
bughelp wanted

倉庫指標

星標
 (7,000 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

Expected behavior: Nested selectors should include escaped $ in its parent's selector

Describe the bug: selectors that are nested drop the $ and keep the escape backslash, while their parent selector includes \$.

  1. Open up https://cssinjs.org/repl
  2. On line 23, change the selector to '$Button' or '\$Button'
  3. Observe the nested selectors generated

The issue happened in my react app where components are mangled by webpack, and some of them starts with $ (like $z). In that situation, the nested selectors do not work.

Codesandbox link: Just use the https://cssinjs.org/repl

Versions (please complete the following information):

  • jss: 10.0.0
  • Browser [e.g. chrome, safari]: chrome
  • OS [e.g. Windows, macOS]: windows Feel free to add any additional versions which you may think are relevant to the bug.

Annotation 2020-03-25 174036

貢獻者指南