-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@starting-style not supported in <style> blocks #9267
Comments
This is a very important feature to me! Another demo (not Svelte): https://codepen.io/web-dot-dev/pen/zYeJbgw?editors=0100 Is there a way to prevent this from being stripped in the mean time? Edit: I ended up putting this code in a global CSS file. |
This is not even supported yet by two of the major browsers. |
True! Yet it is still important to me. Including it doesn't hurt anything in browsers that don't support it so it is progressive enhancement. |
Still a good idea to address it, because the implementation would likely affect other |
at rules are now left alone and you can have nested css in them which is scoped correctly. This just adds a test so we don't regress in the future closes #9267
at rules are now left alone and you can have nested css in them which is scoped correctly. This just adds a test so we don't regress in the future closes #9267
btw there's workaround :root {
@starting-style {
.selector { ..styles }
}
} you could also use local synax .selector {
@starting-style {
..styles
}
} but I've noticed it doesn't work for here's a small demo |
@HugeLetters doesn't seem to work for Svelte 4. (I mean the style works, but it doesn't remove the warning). |
Describe the bug
Given this style block:
Svelte outputs the following CSS:
Note the empty ruleset within the
@starting-style
block. This rule is required to enable discrete entry transitions e.g. fromdisplay: none
. Ideally, Svelte should be adding a scoped.card.svelte-[hash]
rule within that block to the stylesheet.Moreover, supporting this declaration would also likely help unlock more performant transitions directives provided by Svelte itself, without the need for JS functions.
Possibly related:
#8587
Reproduction
Not Working (Svelte)
https://svelte.dev/repl/74f096b3e2884455b47b9e6a2e6b24e9?version=4.2.1
Working (Codepen)
https://codepen.io/jrmoynihan/pen/jOXxeWG?editors=1111
Logs
No response
System Info
Severity
annoyance
The text was updated successfully, but these errors were encountered: