+ 1
Can I use function for variables values in CSS?
Good day for everyone who read me☺️ I’m trying to practice CSS making a watch🕐 and I want to use variables to set sizes of elements. In order to do that, I think it’s better when I change one element, all elements change too. So, I wonder 1️⃣if I can use the function calc() to set values for variables and 2️⃣if it’s possible to make one variable dependent of other one. Is this code right?: :root { —boxSize: 35rem; —watchSize: calc( var(—boxSize)*92.85% ) } Thank you very much for everyone who can help me with this. 😁
2 Respuestas
+ 5
Yes but you need to add space b/w the * operator.
0
Last answer worked. Thanks, Aswajith!🤗
Just one thing to say: 92.85% was changed for 0.9285