lightningcss
lightningcss copied to clipboard
z-index rounded
Any z-index value above 999999
seems to get rounded:
Despite 2147483647 being the seemingly most common answer for max z-index value:
most browsers limit it to signed 32-bit values (−2147483648 to +2147483647) in practice
Similar problems exist with <integer>
values in other properties.
input
.foo {
aspect-ratio: 99999988888;
column-count: 99999988888;
counter-increment: my-counter 99999988888;
}
Output
.foo {
aspect-ratio: 100000000000;
column-count: 100000000000;
counter-increment: my-counter 100000000000;
}
Appears to be the default behavior in rust-cssparser when serializing number tokens. Any property we don't explicitly parse, or when the value is a raw token (eg with var() references) relies on that. Might need to file an issue there: https://github.com/servo/rust-cssparser/blob/master/src/serializer.rs
That looks like it will need to rely on an upstream solution.
Ran into a similar issue today with a number with lots of decimal places being rounded prematurely. I didn't see a dedicated issue on the rust-cssparser repo, but I commented on a related one: https://github.com/servo/rust-cssparser/pull/173#issuecomment-1295312238