-
Notifications
You must be signed in to change notification settings - Fork 18
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
Is it possible to use the negative value of a variable? #64
Comments
I haven't tried this, but you might be able to use
|
Edited my above comment to remove the incorrect part :) @axelson just did a quick try using |
Thanks, although I would prefer a solution that doesn't require adding in another postcss plugin. For now I'm just using scss variables when I need to negate them. |
You can achieve that with CSS variables:
|
Thank you so much!!! |
left: calc(- var(--button-size)); |
Weird, this does not work. does not work --dash: 500;
stroke-dashoffset: calc(-var(--dash));
/* or */
stroke-dashoffset: calc(var(--dash) * -1); works stroke-dashoffset: -500; also works (positive value / wrong direction) stroke-dashoffset: var(--dash); What's wrong? Update: Ok I think it's because this value cannot be animated. (btw. it's in a keyframe animation) My solution is to create two variables. Positive and the negative one. |
just leaving something that can help anyone
this works for me :) |
@apacsa really nice trick ;-) |
So if I have:
Can I do something like:
The text was updated successfully, but these errors were encountered: