SIGN IN SIGN UP
withastro / astro UNCLAIMED

The web framework for content-driven websites. ⭐️ Star to support our work!

0 0 112 TypeScript

Fix missing CSS for conditionally rendered Svelte components (#16823)

* fix(css): restore deleted CSS assets needed by cssScopeTo recovery for conditionally rendered Svelte components

* fix(css): only restore deleted CSS for components not rendered in SSR

The restore logic was too broad — it restored any deleted CSS asset
found in pagesToCss, but the normal parent walk also adds deleted CSS
IDs there for components whose styles are already on the page from SSR.

Track which component exports were rendered during SSR via
ssrRenderedExports. Only flag deleted CSS for restore when the
cssScopeTo target was NOT rendered in SSR (i.e. the styles were
actually tree-shaken and missing from the page).

* Simplify changeset to user-facing message

---------

Co-authored-by: Matthew Phillips <matthew@matthewphillips.info>
H
Houston (Bot) committed
3df6a453243ff4d1d983d0fb6d259617f50be211
Parent: 90ee151
Committed by GitHub <noreply@github.com> on 5/26/2026, 1:19:40 PM