Breakpoints variables

Vieport breakpoint variables

Common device screen sizes are set up as variables to make it easier and faster to write media queries. The variables follow a specific pattern to make the variables easy to remember.

Breakpoint variables are constructed based on the following pattern:

1@media @[device]-[size]-[min/max]

Device Options:

  • mobile
  • tablet
  • laptop
  • desktop

Size Options

  • small
  • large

Examples:

To target a screen width of 319px and below:
1@media @mobile-small-max
Which will output the following CSS:
1@media only screen and (max-width: 319px)
To target a viewport width of 1280px and above:
1@media @desktop-large-min
Which will output the following CSS:
1@media only screen and (min-width: 1280px)
To target mobile devices with a screensize less than 320px wide you can write the following:

Complete list of defined media query variables:

Max Width VariableScreen Width PXMin Width VariableScreen Width PX
@mobile-small-max319px@mobile-small-min320px
@mobile-large-max479px@mobile-large-min480px
@tablet-small-max599px@tablet-small-min600px
@tablet-large-max767px@tablet-large-min768px
@laptop-small-max991px@laptop-small-min992px
@laptop-large-max1279px@laptop-large-min1280px
@desktop-small-max1599px@desktop-small-min1600px
@desktop-large-max1919px@desktop-large-min1920px