From 4009a13330c01a19494880f01cba55ba176995af Mon Sep 17 00:00:00 2001 From: 1aron Date: Mon, 6 Nov 2023 01:39:43 +0800 Subject: [PATCH] Fix: `initRuntime()` is missing the default `document` --- packages/css/src/core.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/css/src/core.ts b/packages/css/src/core.ts index 4f6b9f604..eba4624e5 100644 --- a/packages/css/src/core.ts +++ b/packages/css/src/core.ts @@ -457,6 +457,8 @@ export class MasterCSS { return this } + if (!targetRoot) targetRoot = document + // @ts-ignore this.root = targetRoot const isDocumentRoot = targetRoot === document @@ -1402,7 +1404,7 @@ export class MasterCSS { + '}' } - const keyframeRulesIndex = this.hasVariablesRule ? 1 : 0 + const keyframeRulesIndex = this.hasVariablesRule ? 1 : 0 let keyframeRule: Rule if (this.hasKeyframesRule) { (keyframeRule = this.rules[keyframeRulesIndex]).natives.push(nativeRule)