Skip to content

fix: update CSS custom properties on preview panel resize#22

Merged
Huxpro merged 2 commits intomainfrom
Huxpro/fix-vw-resize
Mar 17, 2026
Merged

fix: update CSS custom properties on preview panel resize#22
Huxpro merged 2 commits intomainfrom
Huxpro/fix-vw-resize

Conversation

@Huxpro
Copy link
Copy Markdown
Member

@Huxpro Huxpro commented Mar 17, 2026

The --lynx-vh and --lynx-vw custom properties inside now dynamically update when the preview panel is resized. Previously, injectStyleRules only took effect at template load time, preventing viewport unit calculations from responding to dimension changes.

We now maintain a <style> element in the shadow DOM and update it directly on each resize event, ensuring vh/vw viewport units work correctly as the container is resized.

The --lynx-vh and --lynx-vw custom properties are now dynamically updated
when the preview panel is resized. Previously, injectStyleRules only took
effect at template load time, so dimensions weren't recalculated on resize.

Now we maintain a <style> element in the shadow DOM and update it directly
on each resize, ensuring vh/vw viewport units inside <lynx-view> respond
to container dimension changes.
@netlify
Copy link
Copy Markdown

netlify bot commented Mar 17, 2026

Deploy Preview for lynx-go-web ready!

Name Link
🔨 Latest commit f308c93
🔍 Latest deploy log https://app.netlify.com/projects/lynx-go-web/deploys/69b939de1d31ca0008a8cf3d
😎 Deploy Preview https://deploy-preview-22--lynx-go-web.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Replace shadow DOM <style> element approach with setting CSS custom
properties directly on the host element's inline style, which is
inherited by shadow DOM descendants immediately and reliably.
@Huxpro Huxpro merged commit 4475f6d into main Mar 17, 2026
7 checks passed
@Dugyu Dugyu deleted the Huxpro/fix-vw-resize branch April 16, 2026 06:35
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