D
D
Denis Bukreev2016-08-31 22:49:41
Frontend
Denis Bukreev, 2016-08-31 22:49:41

The stylus preprocessor does not process variables in the calc() expression, what to do?

I ran into a terrible problem: I write in .styl height: calc(100vh - $h_footer - $h_header)and both variables are transferred to html in their original state:
3e89e2cd72844a9d95a398b9804c4d2c.png
What should I do? How to live?
Is it possible to fight this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Elwen, 2016-08-31
@denisbookreev

If you only want to pass in the final value of the calculation, then don't use calc().
Simple height: 100vh - $h_footer - $h_header
If you need to use calc(), then

height: "calc( 100vh - %s - %s )" % ($h_footer $h_header)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question