How to use window.innerHeight with Sass in an @if statement

Viewed 168

I need to resize a certain element depending on if the viewport in portrait orientation is really short (let's say a small iPhone for example). How would I use a Sass @if statement in conjunction with vh in order to make this happen, if say the statement were to be executed if the screen's height was less than 500px?

Thanks!

1 Answers

You can use media queries , it works like : if the heigth is lower than (xxx) do {xxx}, I'll give you an example that you can implement using sass:

// this query will be executes when the heigth is less than 500px
@media only screen and (min-height: 500px)
     .body
          // do what you want here
Related