Change $ in CSS to prefix placeholder

This commit is contained in:
Talia 2022-06-09 14:03:19 +02:00
parent 52ec210fc6
commit ec0edc9864
2 changed files with 3 additions and 4 deletions

5
css.js
View File

@ -1,9 +1,8 @@
const diversify = (prefix, now, ...rest) =>
now
? now.split(/, */g)
.map(current => current.replace(/\$/g, '.'))
.map(current => current[0] == "_"
? diversify(prefix+current.slice(1), ...rest)
.map(current => current.match(/\$/)
? diversify(current.replaceAll(/\$/g, prefix), ...rest)
: diversify(prefix+' '+current, ...rest)
).join(",")
: prefix

View File

@ -48,7 +48,7 @@ document.head.append(html.style(css({
],
cursor: "pointer",
},
$top: {
'.top': {
"scroll-to-top": {
opacity: 0,
transform: `translate(0px, ${CSS.em(radius * 2)})`,