Skip to content
0

Breakpoints ​

Mobile-first breakpoint system with 7 tiers.

Map ​

KeyValue
xs0
sm640px
md768px
lg1024px
xl1280px
2xl1536px
3xl1920px

Generic mixin ​

scss
@use "katanakit-js/scss/mixins" as m;

@include m.breakpoint($from, $direction: up, $to: null) { ... }
DirectionBehavior
upmin-width (default)
downmax-width (anti-overlap: −0.02px)
onlyBetween $from and next breakpoint
betweenBetween $from and $to

Named aliases ​

scss
@include m.xs { ... }        // 0 and up
@include m.sm { ... }        // 640px and up
@include m.md { ... }        // 768px and up
@include m.lg { ... }        // 1024px and up
@include m.xl { ... }        // 1280px and up
@include m.xxl { ... }       // 1536px and up
@include m.xxxl { ... }      // 1920px and up

@include m.sm-down { ... }   // below 640px
@include m.md-down { ... }   // below 768px
@include m.lg-down { ... }   // below 1024px
@include m.xl-down { ... }   // below 1280px
@include m.x2l-down { ... }  // below 1536px
@include m.x3l-down { ... }  // below 1920px

Feature queries ​

scss
@include m.portrait       { ... }  // orientation: portrait
@include m.landscape      { ... }  // orientation: landscape
@include m.reduced-motion { ... }  // prefers-reduced-motion: reduce
@include m.hoverable      { ... }  // hover: hover + fine pointer
@include m.touch          { ... }  // hover: none + coarse pointer
@include m.dark-mode      { ... }  // prefers-color-scheme: dark
@include m.light-mode     { ... }  // prefers-color-scheme: light

Released under the MIT License.