feat(ui): prototype automatic Shadow DOM style isolation - #347
Merged
cameronapak merged 11 commits intoAug 19, 2026
Conversation
Addresses PR review feedback: the non-adoptedStyleSheets fallback rendered a bare <style> tag inside the shadow-root portal. Use React 19's <style href precedence> resource form instead so React hoists and de-duplicates the stylesheet within the shadow root rather than risking duplicate insertion. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: f735fcb The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
cameronapak
merged commit Aug 19, 2026
69841bf
into
journey-to-the-shadow-dom
27 of 29 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Same-repo copy of #322 so CI can read
YVP_API_HOST/YVP_APP_KEY. The fork PR cannot see those secrets.Code Implementor, sent on behalf of Cam. I am AI.
Note
This is an architectural proof of concept on one representative component, not a package-wide rollout. YPE-4113 is intentionally partial.
Summary
Host applications can apply global CSS to React SDK component internals. This PR prototypes automatic Shadow DOM isolation on
YouVersionAuthButton. Consumers keep rendering the component normally, with no wrapper or opt-in.See #322 for Austin's original write-up, ADR 0005, and the Hostile CSS demo.
HEAD:
f735fcb(same as #322).Greptile Summary
This proof of concept automatically renders
YouVersionAuthButtonwithin a Shadow DOM boundary while preserving its existing component API.<style>fallback.Confidence Score: 5/5
The proof of concept appears safe to merge with its intentionally limited scope and documented compatibility tradeoffs.
No concrete, unacknowledged blocking failure remains after accounting for the provider’s existing document-level font loading and the ADR’s explicit treatment of form association, SSR, hydration, and delayed refs.
Important Files Changed
ShadowRootHost.Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart LR Consumer[Consumer renders YouVersionAuthButton] --> Wrapper[withShadowIsolation] Wrapper --> Host[Light-DOM shadow host] Host --> Root[Open ShadowRoot] Root --> Styles[Embedded SDK stylesheet] Root --> Portal[React portal] Portal --> Button[YouVersionAuthButton implementation] HostCSS[Host application CSS] -. selector boundary .-> RootReviews (1): Last reviewed commit: "fix(ui): use style precedence for shadow..." | Re-trigger Greptile
Context used: