Skip to content

fix: stop CSS traversal at page boundaries#16116

Merged
ematipico merged 7 commits intowithastro:mainfrom
riderx:fix/css-graph-boundary-i18n
Mar 31, 2026
Merged

fix: stop CSS traversal at page boundaries#16116
ematipico merged 7 commits intowithastro:mainfrom
riderx:fix/css-graph-boundary-i18n

Conversation

@riderx
Copy link
Copy Markdown
Contributor

@riderx riderx commented Mar 27, 2026

Summary

  • stop CSS parent traversal once a real top-level page boundary is reached
  • add a minimal astro:i18n fixture that reproduces CSS leaking between unrelated pages
  • add regression coverage for docs-only CSS leaking onto /

Closes #16115.
Originally reported in withastro/starlight#3787.

Testing

  • pnpm -C packages/astro exec astro-scripts test "test/{page-level-styles,i18n-css-leak}.test.js"

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 27, 2026

🦋 Changeset detected

Latest commit: 70af964

The changes in this PR will be included in the next version bump.

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

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Mar 27, 2026

Merging this PR will not alter performance

✅ 18 untouched benchmarks


Comparing riderx:fix/css-graph-boundary-i18n (70af964) with main (47a394d)1

Open in CodSpeed

Footnotes

  1. No successful run was found on main (9a50757) during the generation of this report, so 47a394d was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@riderx
Copy link
Copy Markdown
Contributor Author

riderx commented Mar 30, 2026

@matthewp hey any chance to get a review this fix a bug that break my website in prod i'm stuck with astro 5 because of it

Copy link
Copy Markdown
Member

@ematipico ematipico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please submit a changeset

@riderx
Copy link
Copy Markdown
Contributor Author

riderx commented Mar 31, 2026

@ematipico done

@ematipico ematipico merged commit 12602a9 into withastro:main Mar 31, 2026
26 of 27 checks passed
@astrobot-houston astrobot-houston mentioned this pull request Mar 31, 2026
@matthewp
Copy link
Copy Markdown
Contributor

Great fix!

@riderx
Copy link
Copy Markdown
Contributor Author

riderx commented Apr 2, 2026

i confirm it fix my prod website

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg: astro Related to the core `astro` package (scope)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CSS graph traversal can cross page boundaries via astro:i18n and leak styles between pages

3 participants