W
W
Web Lizard2016-09-01 14:50:14
css
Web Lizard, 2016-09-01 14:50:14

How to make Calc elements in sass with variables?

I'm trying to put variables in calc. I do it this way:

$h: 100%
width: calc($h / 3 - 1px)

But on rendering, this is what happens:
width: calc($h/3 - 1px);
So is it possible to use variables in calc somehow?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey delphinpro, 2016-09-01
@Lizard-108

$h: percentage(1/3);
width: calc(#{$h}  - 1px);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question