File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
packages-integrations/runtime/src Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -164,7 +164,14 @@ export default async function init(inlineConfig: RuntimeOptions = {}): Promise<v
164164
165165 runtimeOptions . configResolved ?.( userConfig , userConfigDefaults )
166166 const uno = await createGenerator ( userConfig , userConfigDefaults )
167- const inject = ( styleElement : HTMLStyleElement ) => runtimeOptions . inject ? runtimeOptions . inject ( styleElement ) : html ( ) . prepend ( styleElement )
167+ const inject = ( styleElement : HTMLStyleElement ) => {
168+ const rootElement = inlineConfig . rootElement ?.( )
169+ if ( rootElement ) {
170+ rootElement . appendChild ( styleElement )
171+ return
172+ }
173+ runtimeOptions . inject ? runtimeOptions . inject ( styleElement ) : html ( ) . prepend ( styleElement )
174+ }
168175 const rootElement = ( ) => runtimeOptions . rootElement ? runtimeOptions . rootElement ( ) : defaultDocument . body
169176 const styleElements = new Map < string , HTMLStyleElement > ( )
170177
You can’t perform that action at this time.
0 commit comments