応答の適用


应答的适用


breakpoint

  • breakpoint以下の変数でカスタマイズ可能.
  • $grid-breakpoints: (
      xs: 0,
      sm: 576px,
      md: 768px,
      lg: 992px,
      xl: 1200px,
      xxl: 1400px
    );

    使用

    $media-breakpoint-up最大幅$media-breakpoint-down最小幅を示す・通過@include代替미디어 쿼리略語として便利に使用できる.
    // min-width
    @include media-breakpoint-up(sm) { ... }
    @include media-breakpoint-up(md) { ... }
    @include media-breakpoint-up(lg) { ... }
    @include media-breakpoint-up(xl) { ... }
    @include media-breakpoint-up(xxl) { ... }
    
    // sm
    @media (min-width: 576px) { ... }
    // md
    @media (min-width: 768px) { ... }
    // lg
    @media (min-width: 992px) { ... }
    // xl
    @media (min-width: 1200px) { ... }
    // xxl
    @media (min-width: 1400px) { ... }
    
    // ex
    .custom-class {
      display: none;
    }
    @include media-breakpoint-up(sm) {
      .custom-class {
        display: block;
      }
    }
    // max-width
    @include media-breakpoint-down(sm) { ... }
    @include media-breakpoint-down(md) { ... }
    @include media-breakpoint-down(lg) { ... }
    @include media-breakpoint-down(xl) { ... }
    @include media-breakpoint-down(xxl) { ... }
    
    // sm
    @media (max-width: 575.98px) { ... }
    // md
    @media (max-width: 767.98px) { ... }
    // lg
    @media (max-width: 991.98px) { ... }
    // xl
    @media (max-width: 1199.98px) { ... }
    // xxl
    @media (max-width: 1399.98px) { ... }
    
    // ex
    @include media-breakpoint-down(md) {
      .custom-class {
        display: block;
      }
    }