-
-
Notifications
You must be signed in to change notification settings - Fork 188
3.0.0 CSS Variable hyphen compiling change #403
Comments
Please provide correct examples. :root {
--space: 32px;
--space-075: 24px;
}
body {
margin-left: -var(--space);
margin-bottom: -var(--space-075);
} and expect this body {
margin-left: -32px;
margin-bottom: -24px;
} If that's the case (cause I don't understand the -075 purpose otherwise), it's working this way on the playground http://cssnext.io/playground/ |
@MoOx I did. Good catch. The playground is using 3.0.0? |
Cool. I’m consistently getting the compiled results I stated, and the version bump affects it. But I am running it through vue-loader. Again, weirdly, changing the cssnext version in Thanks for your time! 🍻 |
@DangoDev Did you find what it was? We are having the same issue after upgrading cssnext and webpack to 3. We don't use vue |
@MoOx @DangoDev I am having the same issue, although the problem arise when using var in combination with calc. Manage to reproduce in playground.
Result:
I guess this falls on postcss-calc plugin. |
calc(12 / 10)px is not valid in the first place |
Alright! That is good to know, will change in my implementation 👍 Although i'm not sure how that affects the hyphen.
Even unit-less produces without the hyphen. |
Indeed that's a postcss-calc bug. I opened this MoOx/reduce-css-calc#30 |
@tranan89 No; I’ve just been dancing around the issue introduced in 3.0.0. It’s still a problem for me. But for some reason I had trouble recreating the bug in the playground, so I was thinking it was something bizarre happening in the stack somewhere. I’m glad others were able to reproduce it! I just haven’t had the time to isolate the bug and follow up. |
Take 2 CSS variables:
In both 2.9.x and 3.0.0, the variables compile correctly when used by themselves. However, something interesting happens when you try and invert those values:
2.9.x
3.0.0
I rolled back my version to double-test, and confirmed it’s compiling differently with 3.0.0. Am I missing something? Are hyphens not part of the variable spec? Is it bad practice to prepend/append CSS variables?
The text was updated successfully, but these errors were encountered: