From bd347052e9e8718f6b897a55f76cbb0f7c0948aa Mon Sep 17 00:00:00 2001 From: CoolElectronics Date: Tue, 9 Apr 2024 22:28:49 -0400 Subject: [PATCH] hopefully fix css hang --- src/css.js | 4 ++-- tsconfig.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/css.js b/src/css.js index cb423e7..1a4c6cf 100644 --- a/src/css.js +++ b/src/css.js @@ -24,7 +24,8 @@ export function css(strings, ...values) { let newstr = '' let selfstr = '' while (!styleElement.sheet.cssRules.length) { - let [first, ...rest] = str.split('\n') + let [first, ...rest] = str.split('\n'); + if (!first) break; selfstr += first + '\n' str = rest.join('\n') styleElement.textContent = str @@ -36,7 +37,6 @@ export function css(strings, ...values) { } styleElement.textContent = `.${uid} {${selfstr}}` + '\n' + newstr - console.log(styleElement.textContent) cssmap[str] = uid return uid diff --git a/tsconfig.json b/tsconfig.json index 91b96bf..558a9de 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -18,6 +18,6 @@ "noUncheckedIndexedAccess": true }, - "include": ["./examples/*.ts", "./examples/*.tsx", "./DreamlandJS.d.ts"], + "include": ["./examples/*.ts", "./examples/*.tsx", "./dreamland.d.ts"], "exclude": ["node_modules/**/*"] }