You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 1ddadee
Browse filesBrowse the repository at this point in the historyBrowse files
fix(createGlobalStyle): keep each global style's CSS when two differ only in their functions (#5847)
* fix(createGlobalStyle): keep each global style's CSS when ids collide
Instance entries move to a module-level registry keyed by component id, so a rebuild re-inserts every global style sharing the id; server renders append a first-seen instance.
* test(createGlobalStyle): drop assertions on an id property 6.x never sets
* fix(createGlobalStyle): key global style instances by sheet
* fix(createGlobalStyle): bound server appends, keep definition order, reallocate on sheet swap
* fix(createGlobalStyle): order same-id globals by mount, an update keeps its place
* fix(createGlobalStyle): keep server-sheet entries so a repeat render keeps its siblings
* docs: state the server-detection gate rule as the code has it
Each `createGlobalStyle` applies its own CSS when two global styles differ only in what their functions return, including bodies that are only a function (`createGlobalStyle\`${() => 'html { --a: 1; }'}\``). This is how a CSS reset and a color-mode style are often written together, for example xstyled's Preflight and ColorModeProvider. When both set the same property, the one mounted most recently wins, and a prop or theme update does not change which one that is.
6
+
7
+
When several mounts of one dynamic global style render on the server, the collected styles include every one of them, not only the last.
0 commit comments