+ 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 Answers
+ 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