- url() - calc() - rgb/rgba() - hsl/hsla() - linear/radial-gradient() - counter() - attr() - scale()/rotate()/translate()
calc()
The calc() CSS function can be used anywhere a <length>, <frequency>, <angle>, <time>, <number>, or <integer> is required. With calc(), you can perform calculations to determine CSS property values.
- Mozilla Developer Network (MDN)
calc() supports +, -, /, * operators
you need whitespace around the + and - operators. Without that it's considered invalid syntax.
Why? CSS Variables Forward Compatibility
calc( calc(20px / 2) / 4) /* becomes... */ calc( (20px / 2) / 4) = 2.5px
CSS variables can be used to make this look simpler.
--calcA : calc(20px / 2); --calcB : calc( var(--calcA) / 4);
https://webdesign.tutsplus.com/tutorials/calc-grids-are-the-best-grids--cms-22902
http://zerosixthree.se/create-css-grid-using-calc/
https://www.smashingmagazine.com/2015/12/getting-started-css-calc-techniques/
https://mdn.io/calc
https://drafts.csswg.org/css-values-4/#funcdef-calc
By Praveen Puglia