mirror of https://github.com/sveltejs/svelte
fix: preserve namespaces in CSS type selectors (#18678)
Fixes #18677. - preserve namespace prefixes on CSS `TypeSelector` AST nodes - accept wildcard local names in `svg|*` and `*|*` - retain namespaces when printing modern ASTs - keep namespaced universal selectors intact while adding scoped CSS selectors - add compile and print regressions covering all four namespace forms --------- Co-authored-by: svelte-triage-bot <team@svelte.com> Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>pull/18537/merge
parent
19aa51d443
commit
9c2494b134
@ -0,0 +1,5 @@
|
||||
---
|
||||
'svelte': patch
|
||||
---
|
||||
|
||||
fix: preserve namespaces in CSS type selectors
|
||||
@ -0,0 +1,17 @@
|
||||
@namespace svg url(http://www.w3.org/2000/svg);
|
||||
|
||||
svg|circle.svelte-xyz {
|
||||
fill: red;
|
||||
}
|
||||
|
||||
*|circle.svelte-xyz {
|
||||
stroke: blue;
|
||||
}
|
||||
|
||||
svg|*.svelte-xyz {
|
||||
color: green;
|
||||
}
|
||||
|
||||
*|*.svelte-xyz {
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
After Width: | Height: | Size: 208 B |
@ -0,0 +1,10 @@
|
||||
<style>
|
||||
@namespace svg url(http://www.w3.org/2000/svg);
|
||||
|
||||
svg|circle,
|
||||
*|circle,
|
||||
svg|*,
|
||||
*|* {
|
||||
fill: red;
|
||||
}
|
||||
</style>
|
||||
@ -0,0 +1,12 @@
|
||||
|
||||
|
||||
<style>
|
||||
@namespace svg url(http://www.w3.org/2000/svg);
|
||||
|
||||
svg|circle,
|
||||
*|circle,
|
||||
svg|*,
|
||||
*|* {
|
||||
fill: red;
|
||||
}
|
||||
</style>
|
||||
Loading…
Reference in new issue