S
S
sorry_i_noob2019-09-22 14:47:54
Sass
sorry_i_noob, 2019-09-22 14:47:54

Is there a way to do an if in SCSS for the width of the screen?

I have a certain value calculated in SCSS - depending on the width of a certain block. But the width of the block changes depending on the width of the screen (media queries).
Is it possible to write something similar in SCSS?

if ширина экрана > 768, то
    var_1 = 500.
if ширина экрана < 769, то
    var_1 = 300.
Конец if. 

var_2 = var_1 - ... (какой-то другой код)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
i10dev, 2019-09-22
@i10dev

media only screen and (max-width: 600px) {
$width: 5em;
}
media only screen and (max-width: 700px) {
$width: 50em;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question