Add $ and _ handling in CSS
This commit is contained in:
parent
13f8ba591a
commit
f877be4806
1 changed files with 6 additions and 1 deletions
7
css.js
7
css.js
|
@ -1,6 +1,11 @@
|
||||||
const diversify = (prefix, now, ...rest) =>
|
const diversify = (prefix, now, ...rest) =>
|
||||||
now
|
now
|
||||||
? now.split(/, */g).map(current => diversify(prefix+' '+current, ...rest)).join(",")
|
? now.split(/, */g)
|
||||||
|
.map(current => current.replace(/\$/g, '.'))
|
||||||
|
.map(current => current[0] == "_"
|
||||||
|
? diversify(prefix+current.slice(1), ...rest)
|
||||||
|
: diversify(prefix+' '+current, ...rest)
|
||||||
|
).join(",")
|
||||||
: prefix
|
: prefix
|
||||||
|
|
||||||
const keyToPropName = key => key.replace(/^[A-Z]/, a => "-"+a).replace(/[A-Z]/g, a => '-'+a.toLowerCase())
|
const keyToPropName = key => key.replace(/^[A-Z]/, a => "-"+a).replace(/[A-Z]/g, a => '-'+a.toLowerCase())
|
||||||
|
|
Loading…
Reference in a new issue