2019-04-30 11:11:25 +08:00
|
|
|
@mixin make-grid($class) {
|
2019-12-06 09:58:08 +08:00
|
|
|
@for $i from 1 through $Grid-columns {
|
|
|
|
.#{$ns}Grid-col--#{$class}#{$i} {
|
|
|
|
flex: 0 0 percentage($i / $Grid-columns);
|
|
|
|
max-width: percentage($i / $Grid-columns);
|
|
|
|
min-height: 1px;
|
|
|
|
padding-left: ($Grid-gutterWidth / 2);
|
|
|
|
padding-right: ($Grid-gutterWidth / 2);
|
2019-04-30 11:11:25 +08:00
|
|
|
}
|
2019-12-06 09:58:08 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
.#{$ns}Grid-col--#{$class} {
|
|
|
|
flex-basis: 0;
|
|
|
|
flex-grow: 1;
|
|
|
|
min-height: 1px;
|
|
|
|
max-width: 100%;
|
2021-08-04 16:53:52 +08:00
|
|
|
width: 100%;
|
2019-12-06 09:58:08 +08:00
|
|
|
padding-left: ($Grid-gutterWidth / 2);
|
|
|
|
padding-right: ($Grid-gutterWidth / 2);
|
|
|
|
}
|
2021-07-29 23:45:32 +08:00
|
|
|
|
|
|
|
.#{$ns}Grid-col--#{$class}Auto {
|
|
|
|
flex: 0 0 auto;
|
|
|
|
width: auto;
|
|
|
|
max-width: 100%;
|
|
|
|
padding-left: ($Grid-gutterWidth / 2);
|
|
|
|
padding-right: ($Grid-gutterWidth / 2);
|
|
|
|
}
|
2019-04-30 11:11:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// Generate Grid row
|
|
|
|
@mixin make-row($gutter: $Grid-gutterWidth) {
|
2019-12-06 09:58:08 +08:00
|
|
|
margin-left: ($gutter / -2);
|
|
|
|
margin-right: ($gutter / -2);
|
|
|
|
display: flex;
|
|
|
|
flex-wrap: wrap;
|
2019-04-30 11:11:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
@include make-grid(xs);
|
|
|
|
|
|
|
|
@include media-breakpoint-up(sm) {
|
2019-12-06 09:58:08 +08:00
|
|
|
.#{$ns}Grid {
|
|
|
|
@include make-row;
|
2021-06-18 01:38:03 +08:00
|
|
|
flex: 1;
|
2021-08-10 20:33:18 +08:00
|
|
|
|
|
|
|
&--hRight {
|
|
|
|
justify-content: flex-end;
|
|
|
|
}
|
|
|
|
|
|
|
|
&--hCenter {
|
|
|
|
justify-content: center;
|
|
|
|
}
|
|
|
|
&--hBetween {
|
|
|
|
justify-content: space-between;
|
|
|
|
}
|
|
|
|
|
|
|
|
&--vMiddle > div {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
justify-content: center;
|
|
|
|
}
|
|
|
|
|
|
|
|
&--vBottom > div {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
justify-content: flex-end;
|
|
|
|
}
|
|
|
|
|
|
|
|
&--vBetween > div {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
justify-content: space-between;
|
|
|
|
}
|
|
|
|
|
|
|
|
& > &-col--vTop {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
justify-content: flex-start;
|
|
|
|
}
|
|
|
|
|
|
|
|
& > &-col--vMiddle {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
justify-content: center;
|
|
|
|
}
|
|
|
|
|
|
|
|
& > &-col--vBottom {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
justify-content: flex-end;
|
|
|
|
}
|
|
|
|
|
|
|
|
& > &-col--vBetween {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
justify-content: space-between;
|
|
|
|
}
|
2019-12-06 09:58:08 +08:00
|
|
|
}
|
2019-05-15 16:10:20 +08:00
|
|
|
|
2019-12-06 09:58:08 +08:00
|
|
|
@include make-grid(sm);
|
2019-04-30 11:11:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
@include media-breakpoint-up(md) {
|
2019-12-06 09:58:08 +08:00
|
|
|
@include make-grid(md);
|
2019-04-30 11:11:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
@include media-breakpoint-up(lg) {
|
2019-12-06 09:58:08 +08:00
|
|
|
@include make-grid(lg);
|
2019-04-30 11:11:25 +08:00
|
|
|
}
|
2021-08-10 20:33:18 +08:00
|
|
|
|
|
|
|
.#{$ns}Grid--none {
|
|
|
|
margin-left: 0;
|
|
|
|
margin-right: 0;
|
|
|
|
|
|
|
|
> div {
|
|
|
|
padding-left: 0;
|
|
|
|
padding-right: 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.#{$ns}Grid--xs {
|
|
|
|
margin-left: calc(var(--gap-xs) * -0.5);
|
|
|
|
margin-right: calc(var(--gap-xs) * -0.5);
|
|
|
|
|
|
|
|
> div {
|
|
|
|
padding-left: calc(var(--gap-xs) * 0.5);
|
|
|
|
padding-right: calc(var(--gap-xs) * 0.5);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.#{$ns}Grid--sm {
|
|
|
|
margin-left: calc(var(--gap-sm) * -0.5);
|
|
|
|
margin-right: calc(var(--gap-sm) * -0.5);
|
|
|
|
|
|
|
|
> div {
|
|
|
|
padding-left: calc(var(--gap-sm) * 0.5);
|
|
|
|
padding-right: calc(var(--gap-sm) * 0.5);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.#{$ns}Grid--base {
|
|
|
|
margin-left: calc(var(--gap-base) * -0.5);
|
|
|
|
margin-right: calc(var(--gap-base) * -0.5);
|
|
|
|
|
|
|
|
> div {
|
|
|
|
padding-left: calc(var(--gap-base) * 0.5);
|
|
|
|
padding-right: calc(var(--gap-base) * 0.5);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.#{$ns}Grid--md {
|
|
|
|
margin-left: calc(var(--gap-md) * -0.5);
|
|
|
|
margin-right: calc(var(--gap-md) * -0.5);
|
|
|
|
|
|
|
|
> div {
|
|
|
|
padding-left: calc(var(--gap-md) * 0.5);
|
|
|
|
padding-right: calc(var(--gap-md) * 0.5);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.#{$ns}Grid--lg {
|
|
|
|
margin-left: calc(var(--gap-lg) * -0.5);
|
|
|
|
margin-right: calc(var(--gap-lg) * -0.5);
|
|
|
|
|
|
|
|
> div {
|
|
|
|
padding-left: calc(var(--gap-lg) * 0.5);
|
|
|
|
padding-right: calc(var(--gap-lg) * 0.5);
|
|
|
|
}
|
|
|
|
}
|