From ec0edc9864c9f72d5c84cd905748dfceeb7e6533 Mon Sep 17 00:00:00 2001 From: DarkWiiPlayer Date: Thu, 9 Jun 2022 14:03:19 +0200 Subject: [PATCH] Change $ in CSS to prefix placeholder --- css.js | 5 ++--- page/scrollToTop.js | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/css.js b/css.js index 46fe307..5a2984e 100644 --- a/css.js +++ b/css.js @@ -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 diff --git a/page/scrollToTop.js b/page/scrollToTop.js index f2a8aad..2f5da1c 100644 --- a/page/scrollToTop.js +++ b/page/scrollToTop.js @@ -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)})`,