D
D
Dmitry2017-03-23 23:27:51
css
Dmitry, 2017-03-23 23:27:51

Sass: how to declare a variable for two @media values?

I 'm stupid to impossibility, tell me, please, how to correctly declare and call a variable in Sass:
I want to write this into a variable, let's say $middle_min-max

(min-width: $screen-md-min) and (max-width: $screen-md-max)

I smoked all the manuals, in SCSS it seems to be easy, but in Sass I can't find the correct syntax...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
bob_cody, 2017-03-24
@mityaer

$screen-md-min: 768px
$screen-md-max: 960px

$middle_min-max: "(min-width:" $screen-md-min + ") and (max-width:" + $screen-md-max + ")"

@media #{$middle_min-max}
  color: red

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question