E
E
Evtera2021-02-15 18:47:37
Sass
Evtera, 2021-02-15 18:47:37

Change variable on media request?

Hello. I change the variable during the media query, but as a result, the media query becomes the main one, and the value of the variable outside the query is simply ignored.

What is the correct way to use a variable in a media query?

$mainFontSizeInContacts: 25px;

@media (max-width: 480px) {
  $mainFontSizeInContacts: 17px !global;
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
andead, 2021-02-15
@andead

SASS variables work at compile time, they are normal values ​​at the output, so you cannot change them in the browser.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question