-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
whitespace and !important token valid in css custom properties but not in svelte #7152
Comments
@baseballyama, thanks you, you 're right.
but still have a bug on
|
Just reposting my comment from #7288 (comment): Looks like the change to the spec that makes Personally I think it would be best to change this in Svelte regardless for better compatibility, it's a change lots of other tools have had to make as well since historically This is what the spec said last time I looked a couple of months ago:
...so I wouldn't be surprised if this sneaky problem shows up a lot for a while. It'll be a while before Electron is on 99 for example I bet. |
Fixes #7152, see also #7288 --foo:; used to be an invalid CSS custom property value, while -foo: ; was valid. By collapsing the whitespace in these declaration values, we were breaking scenarios where an empty custom property was desired. The spec was updated to trim whitespace and treat these values identically, but Chromium browsers still treat --foo; as invalid. This was recently fixed and will be released in Chrome 99, but this would still be a good fix to maintain backwards compatibility.
Fixes sveltejs#7152, see also sveltejs#7288 --foo:; used to be an invalid CSS custom property value, while -foo: ; was valid. By collapsing the whitespace in these declaration values, we were breaking scenarios where an empty custom property was desired. The spec was updated to trim whitespace and treat these values identically, but Chromium browsers still treat --foo; as invalid. This was recently fixed and will be released in Chrome 99, but this would still be a good fix to maintain backwards compatibility.
This should be fixed in 3.46.5 for browsers that don't follow the latest spec. |
Describe the bug
When I read this article The CSS Custom Property Toggle Trick, I am trying to use whitespace in css custom properties with svetle, it say "invalid value", but it should be valid according to W3C custom properties specification.
Ref: https://www.w3.org/TR/css-variables-1/#syntax


Reproduction
svelte REPL: https://svelte.dev/repl/d563fcb1d63e405da8a74ae1ef8f30ad?version=3.46.2
codepen: https://codepen.io/tanangular/pen/rNGPgRa
Logs
No response
System Info
Severity
annoyance
The text was updated successfully, but these errors were encountered: