current theme: placeholder

Docs :: Media Queries

File nameSource
settings.media-queries.cssGithub

Available Media Queries

Dimensions

Token keywordDimension (px)
xxs0-240
xs240-360
sm360-480
md480-768
lg768-1024
xl1024-1440
xxl1440-1920

Variations

Using the md dimension as an example:

Token variationMatches
--md-onlyexact range
--md-n-aboverange top and above
--mdshorthand for --md-n-above
--md-n-belowrange top and below
--md-phoneexact range in portrait only

Examples

Custom media queryValue
@media(--md-only) {}(480px <= width < 768px);
@media(--md) {}(width >= 768px);
@media(--md-n-above) {}(width >= 768px);
@media(--md-n-below) {}(width <section 768px);
@media(--md-phone) {}(--md-only) and (--portrait);

If you search online for the best approach to responsive design and setting up your breakpoints, you’ll come accross the technically true but useless “it depends” answer.

Unless you have a good reason not to, you should use a mobile first approach. What that means is you design will work great on small screen out of the box, without any media queries, and then you add your tweaks for additional sizes.

This is how the CSS of most responsive components should be set up:

<style>
  .exampleComponent {
    /* default mobile */
    @media (--lg) {
      /* responsive tweaks for desktop */
    }
  }
</style>

<div class="exampleComponent">[…]</div>