A
A
Antonio092020-04-15 14:30:13
HTML
Antonio09, 2020-04-15 14:30:13

How to convert from native variables?

border-radius: calc(var(--icon-size) / 2) / var(--icon-size);

how to convert from native variables?

trying

$size = 36px;
border-radius: calc(($size/2) / $size); galp

does not compile errors either

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey delphinpro, 2020-04-15
@Antonio09

$size: 36px;
border-radius: calc(#{($size/2) / $size});

$size: 36px;
$result: ($size/2) / $size;
border-radius: calc(#{$result});

$size: 36px;
border-radius: calc((#{$size}/2) / #{$size});

But none of this makes sense in this case. You can just calculate and insert the value:
$size: 36px;
border-radius: (($size/2) / $size);

D
Dmitry Belyaev, 2020-04-15
@bingo347

https://tutomath.ru/5-klass/delenie-drobej-pravila...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question