Skip to content

feat: v5 inject stencil hydrate css into global-style - #6724

Merged
johnjenkins merged 2 commits into
v5from
v5-static-hydrate-styles
May 17, 2026
Merged

johnjenkins merged 2 commits into
v5from
v5-static-hydrate-styles

Conversation

@johnjenkins

@johnjenkins johnjenkins commented May 17, 2026 •

Copy link
Copy Markdown
Contributor

What is the current behavior?

GitHub Issue Number: N/A

What is the new behavior?

@import "stencil-hydrate" virtual placeholder - add to any global-style input to inject static FOUC-prevention CSS at build time instead of relying on the dynamic <style> tag inserted by the loader. The compiler replaces the placeholder with the sorted component selectors + configured hydration CSS (e.g. my-cmp,other-cmp{visibility:hidden}.hydrated{visibility:inherit}). When detected, BUILD.staticHydrationStyles = true suppresses the loader's dynamic injection. For standalone builds (which have no loader), stencil-hydrate.css is auto-generated alongside the bundle.

Documentation

Does this introduce a breaking change?

  • Yes
  • No

Testing

Other information

@johnjenkins
johnjenkins requested a review from a team as a code owner May 17, 2026 22:03
@johnjenkins
johnjenkins merged commit b29e48e into v5 May 17, 2026
29 checks passed
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