Skip to content
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

Svelte strips off @ in keyframes in CSS #712

Closed
antony opened this issue Jul 18, 2017 · 6 comments
Closed

Svelte strips off @ in keyframes in CSS #712

antony opened this issue Jul 18, 2017 · 6 comments
Labels

Comments

@antony
Copy link
Member

antony commented Jul 18, 2017

One of my users has noticed that the @keyframes CSS directive used in animations is being incorrectly stripped by svelte.

The resultant CSS has simply keyframes, which doesn't work.

You can see a (very quick) example of this here:

https://svelte.technology/repl?version=1.25.0&gist=5ca027094a05859547d066252f1b2ca0

@Conduitry
Copy link
Member

Ooh I bet this is related to the recent changes to tidy up code generation in #673. The unit tests here are still passing because they're looking at the transformed CSS, and not the actual final javascript.

@Conduitry
Copy link
Member

Part of this seems to be that JSON.stringify should be stringify here but also there seem to be other problems that have crept (back?) up. Text nodes containing @ or # are not being correctly escaped, which is also affecting the text in style nodes. Compiling and running a component consisting of @x inserts the text "\@x" which is technically correct but suboptimal, but compiling and running a component consisting of @@x inserts the same "\@x" which is definitely wrong.

@antony
Copy link
Member Author

antony commented Jul 19, 2017

@Conduitry I notice your comment in the original commit #673 - this is exactly the problem!

@PaulBGD
Copy link
Member

PaulBGD commented Jul 19, 2017

Also annoying, it strips off the @ in @media :(

Rich-Harris added a commit that referenced this issue Jul 24, 2017
Rich-Harris added a commit that referenced this issue Jul 24, 2017
Rich-Harris added a commit that referenced this issue Jul 25, 2017
@Rich-Harris
Copy link
Member

Fixed in 1.26, thank you!

@antony
Copy link
Member Author

antony commented Jul 25, 2017

Super! Thanks :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants