feat(wxt-demo): add rem-to-px postcss example for Shadow Root UI#2333
Open
Aniket-lodh wants to merge 4 commits intowxt-dev:mainfrom
Open
feat(wxt-demo): add rem-to-px postcss example for Shadow Root UI#2333Aniket-lodh wants to merge 4 commits intowxt-dev:mainfrom
Aniket-lodh wants to merge 4 commits intowxt-dev:mainfrom
Conversation
✅ Deploy Preview for creative-fairy-df92c4 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
PatrykKuniczak
requested changes
May 4, 2026
Collaborator
PatrykKuniczak
left a comment
There was a problem hiding this comment.
Works well, a couple of changes needed 😄
Co-authored-by: Patryk Kuniczak <p.kuniczak@gmail.com>
Co-authored-by: Patryk Kuniczak <p.kuniczak@gmail.com>
Author
|
@PatrykKuniczak Done. Do tell me if anything else is needed |
Collaborator
|
@Aniket-lodh I've reviewed your second PR. |
Comment on lines
+21
to
+23
| desc.textContent = | ||
| 'This UI uses rem units in CSS, converted to px at build time by postcss-rem-to-responsive-pixel. ' + | ||
| 'It will render at the same size regardless of the host pages root font-size.'; |
Collaborator
There was a problem hiding this comment.
Suggested change
| desc.textContent = | |
| 'This UI uses rem units in CSS, converted to px at build time by postcss-rem-to-responsive-pixel. ' + | |
| 'It will render at the same size regardless of the host pages root font-size.'; | |
| desc.textContent = `This UI uses 'rem' units in CSS, converted to 'px' at build time by 'postcss-rem-to-responsive-pixel'. | |
| It will render at the same size regardless of the host pages root 'font-size'.`; |
Maybe like that?
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.
Overview
Adds a
rem-fix.contentexample towxt-demothat demonstrates how to usepostcss-rem-to-responsive-pixelto convertremunits topxat build time inside acreateShadowRootUicontent script.This prevents host page
font-sizeoverrides (e.g., Reddit'sfont-size: 10pxon<html>) from breaking the extension UI's sizing inside the Shadow DOM.Manual Testing
bun installthenbun run --filter wxt-demo devfont-size(e.g., Reddit) — the card should render at the same size as on other sitesremvalues have been converted topxRelated Issue
Follow-up to #2330 (docs: add warning about rem unit inheritance in Shadow Root UI), as requested by @PatrykKuniczak.
This PR addresses #678