Z
Z
zueck2015-12-03 07:44:31
Sass
zueck, 2015-12-03 07:44:31

How to assign a value to a variable in SASS depending on the screen size?

Suppose there is a variable $a. How can I make it so that if media max-device-width > 1000 then $a = 1000px otherwise $a = 800px.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Andrey Khokhlov, 2015-12-03
@zueck

No way, sass is not processed in the browser, but compiled into css.
And this is how, for example, the width of the container is set in Bootstrap 4, depending on the breakpoints
. Open the source code on the github and study it.

Z
zooks, 2015-12-03
@zooks

It seems that variables are not needed here.
Just use media queries wisely.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question