scss Bootstrap 4 Mixins网格

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了scss Bootstrap 4 Mixins网格相关的知识,希望对你有一定的参考价值。

// Example usage
.some-class {
    @include media-breakpoint-up(sm) {
        // Larger than sm: 480px
        display: inline;
    }
    @include media-breakpoint-down(md) {
        // Smaller than md: 768px
        display: block;
    }
}

/* -------------------------------------------------------------------------- */

// Grid system
// @see https://getbootstrap.com/docs/4.0/layout/grid/#sass-mixins
// Generate semantic grid columns with these mixins.
@include make-container();
// For each breakpoint, define the maximum width of the container in a media query
@include make-container-max-widths($max-widths: $container-max-widths, $breakpoints: $grid-breakpoints);
// Creates a wrapper for a series of columns
@include make-row();
// Make the element grid-ready (applying everything but the width)
@include make-col-ready();
@include make-col($size, $columns: $grid-columns);

// Example usage
/*
<div class="example-container">
  <div class="example-row">
    <div class="example-content-main">Main content</div>
    <div class="example-content-secondary">Secondary content</div>
  </div>
</div>
*/
.example-container {
    width: 800px;
    @include make-container();
}
.example-row {
    @include make-row();
}
.example-content-main {
    @include make-col-ready();

    @include media-breakpoint-up(sm) {
        @include make-col(6);
    }
    @include media-breakpoint-up(lg) {
        @include make-col(8);
    }
}
.example-content-secondary {
    @include make-col-ready();

    @include media-breakpoint-up(sm) {
        @include make-col(6);
    }
    @include media-breakpoint-up(lg) {
        @include make-col(4);
    }
}

以上是关于scss Bootstrap 4 Mixins网格的主要内容,如果未能解决你的问题,请参考以下文章

scss Bootstrap 4 Sass Mixins [带备例的备忘单]

scss Bootstrap 4 Sass Mixins [带备例的备忘单]

scss Bootstrap SCSS Mixins和Modifications

scss Bootstrap mixins

scss 带有mixins的Bootstrap断点。

scss 带有mixins的Bootstrap断点。