-
-
Notifications
You must be signed in to change notification settings - Fork 87
Open
Description
Description
Stylis silently drops CSS declarations where a custom property has an empty value (--prop: ;). Per the CSS spec, --custom-property: ; is valid — it sets the property to the guaranteed-invalid value. This pattern is used in scroll-driven animations and other modern CSS techniques.
Reproduction
import { compile, serialize, stringify } from 'stylis';
// Empty value — dropped entirely
console.log(serialize(compile('.foo { --x: ; }'), stringify));
// Output: "" (empty string)
// In keyframes — entire frame dropped
console.log(serialize(compile('@keyframes foo { from { --x: red; } to { --x: ; } }'), stringify));
// Output: "@keyframes foo{from{--x:red;}}" (the `to` frame is missing)
// Non-empty value — works fine
console.log(serialize(compile('.foo { --x: initial; }'), stringify));
// Output: ".foo{--x:initial;}"Expected
.foo{--x: ;}
@keyframes foo{from{--x:red;}to{--x: ;}}Actual
(empty)
@keyframes foo{from{--x:red;}}Environment
stylis 4.3.6
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels