Skip to content
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

Order of CSS custom variable declarations is inconsistent #855

Closed
NikaBuligini opened this issue Nov 18, 2024 · 0 comments
Closed

Order of CSS custom variable declarations is inconsistent #855

NikaBuligini opened this issue Nov 18, 2024 · 0 comments

Comments

@NikaBuligini
Copy link

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:

  • Go to lightningcss playground
  • Uncheck minify to easily see the difference in the output
  • Set the following as input:
.my-class-name {
  --foo: 1.1em;
  --bar: currentcolor;

  all: unset;
}
  • Keep changing and undoing the input to trigger the compilation (you can also add letters to one of the variable names)
  • You will see that --foo and --bar variables are getting ordered differently
Screen.Recording.2024-11-18.at.14.46.40.mov

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant