parcel-bundler / lightningcss

An extremely fast CSS parser, transformer, bundler, and minifier written in Rust.
https://lightningcss.dev
Mozilla Public License 2.0
6.52k stars 189 forks source link

Order of CSS custom variable declarations is inconsistent #855

Closed NikaBuligini closed 1 day ago

NikaBuligini commented 1 week ago

Lightningcss is ordering CSS custom variables inconsistently.

Even if I don't make changes in the source file I might get a different output. This is a problem since I'm using contenthash in filenames in order to let users keep using cached version of the file when there are no changes in the content. So, change in order effectivelly invalidates cache for users.

How to reproduce:

https://github.com/user-attachments/assets/878a2f90-0e82-4c9c-8b11-15fc31ce435e

If you remove all: unset or move it above variable declarations then the issue with the order can't be reproduced anymore.