Skip to content

fix(isolated-element)!: Use a div instead of html#128

Merged
aklinker1 merged 2 commits intomainfrom
isolated-element-fragment
Feb 9, 2026
Merged

fix(isolated-element)!: Use a div instead of html#128
aklinker1 merged 2 commits intomainfrom
isolated-element-fragment

Conversation

@aklinker1
Copy link
Owner

@aklinker1 aklinker1 commented Feb 9, 2026

Caution

BREAKING CHANGE

A full HTML document is no longer created inside your Shadow DOM. Instead, a simple div is used.

Originally, a full HTML doc was used so CSS frameworks treated your shadow DOM the same as your root page. However, newer version of CSS frameworks support shadow DOMs. If they don't... it will be very obvious because all your styles will be missing. I recommend opening a PR for your framework to add support.

To fix, you just need to add the :host selector to wherever the base styles are set (usually :root or html) to ensure they're also applied to the shadow root host as well:

-:root {
+:root, :host {
   ...
 }

Overview

Recreation of #118.

Next steps:

aklinker1 and others added 2 commits February 9, 2026 00:37
Co-Authored-By: Namu <namuorg@users.noreply.github.com>
@aklinker1 aklinker1 merged commit 40f983b into main Feb 9, 2026
4 checks passed
@aklinker1 aklinker1 deleted the isolated-element-fragment branch February 9, 2026 06:50
@aklinker1 aklinker1 self-assigned this Feb 9, 2026
aklinker1 added a commit to wxt-dev/wxt that referenced this pull request Feb 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant