Skip to content

fix(css): scoped css order with non-scoped css#19678

Merged
patak-cat merged 4 commits intovitejs:mainfrom
sapphi-red:fix/css-scoped-to-order
Mar 20, 2025
Merged

fix(css): scoped css order with non-scoped css#19678
patak-cat merged 4 commits intovitejs:mainfrom
sapphi-red:fix/css-scoped-to-order

Conversation

@sapphi-red
Copy link
Member

Description

This PR changes the implementation of cssScopeTo support to the one proposed in #16058 from #19418.
The implementation in #19418 has a upside of a better chunking behavior, but had a downside of not preserving the style order when a single module has both scoped and non-scoped styles.

refs https://discord.com/channels/804011606160703521/804439875226173480/1349606289252028418
refs withastro/astro#13420

@sapphi-red sapphi-red added feat: css p3-downstream-blocker Blocking the downstream ecosystem to work properly (priority) labels Mar 19, 2025
@sapphi-red sapphi-red added this to the 6.3 milestone Mar 19, 2025
@sapphi-red
Copy link
Member Author

/ecosystem-ci run

@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 19, 2025

Open in Stackblitz

npm i https://pkg.pr.new/vite@19678

commit: 803860f

@vite-ecosystem-ci

This comment was marked as outdated.

bluwy
bluwy previously approved these changes Mar 19, 2025
Copy link
Member

@bluwy bluwy left a comment

Choose a reason for hiding this comment

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

The changes look good to me if we want to go with a different implementation, and we could see how well it works and polish again 👍

@patak-cat patak-cat merged commit a3a94ab into vitejs:main Mar 20, 2025
16 checks passed
@sapphi-red sapphi-red deleted the fix/css-scoped-to-order branch March 24, 2025 01:52
moonlitusun pushed a commit to moonlitusun/vite that referenced this pull request May 25, 2025
Co-authored-by: bluwy <bjornlu.dev@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat: css p3-downstream-blocker Blocking the downstream ecosystem to work properly (priority) trigger: preview

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants