How does Calc () calculate in css?

Can anyone describe usage Calc()in css? And what does the ~meaning of the sign mean with Calc()?

How is the code computed below?

calc(~'(100% - 4 * 23.233%) / 3')
+4
source share
1 answer

This is not a valid value in plain CSS.

It looks like this is from a minor source code that compiled to the following:

calc((100% - 4 * 23.233%) / 3);

As indicated by the relevant LESS documentation , the following are used for shielding ~'':

Escaping . , ~"anything" ~'anything', , interpolation.

, LESS . :

calc(2.3559999999999994%);

. : CSS3 calc".

+7

Source: https://habr.com/ru/post/1668781/


All Articles