Skip to content

Commit

Permalink
fix: Allow global-like pseudo-selectors refinement
Browse files Browse the repository at this point in the history
For instance, specifying a tree-structural pseudo-class to
`::view-transition-new` should still constitute a valid global-like
selector.

Fixes #15312
  • Loading branch information
ccjmne committed Feb 16, 2025
1 parent c40392c commit fdff04f
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/gold-hairs-jog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'svelte': patch
---

fix: allow global-like pseudo-selectors refinement
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ const css_visitors = {

node.metadata.is_global = node.selectors.length >= 1 && is_global(node);

if (node.selectors.length === 1) {
if (node.selectors.length >= 1) {
const first = node.selectors[0];
node.metadata.is_global_like ||=
(first.type === 'PseudoClassSelector' && first.name === 'host') ||
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,15 @@
::view-transition-old {
animation-duration: 0.5s;
}
::view-transition-old:only-child {
animation-duration: 0.5s;
}
::view-transition-new {
animation-duration: 0.5s;
}
::view-transition-new:only-child {
animation-duration: 0.5s;
}
::view-transition-image-pair {
animation-duration: 0.5s;
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,15 @@
::view-transition-old {
animation-duration: 0.5s;
}
::view-transition-old:only-child {
animation-duration: 0.5s;
}
::view-transition-new {
animation-duration: 0.5s;
}
::view-transition-new:only-child {
animation-duration: 0.5s;
}
::view-transition-image-pair {
animation-duration: 0.5s;
}
Expand Down

0 comments on commit fdff04f

Please sign in to comment.