I noticed that negative values are re-encoded with double-negative signs, which breaks the bidirectional conversions for full CSS. For example, trying to parse and re-serialize .card { margin: -1rem }:
require 'minicss'
root = MiniCSS.parse(".card { margin: -1rem }")
puts MiniCSS.serialize(root)
This outputs .card { margin: --1rem }
I think it's because the Number's value is -1.0 and the sign is -, so when the serializer processes it, it outputs both the - string and the - from the negative value.
I noticed that negative values are re-encoded with double-negative signs, which breaks the bidirectional conversions for full CSS. For example, trying to parse and re-serialize
.card { margin: -1rem }:This outputs
.card { margin: --1rem }I think it's because the
Number's value is-1.0and the sign is-, so when the serializer processes it, it outputs both the-string and the-from the negative value.