sass-site/source/assets/sass/layout/_grid-system.scss

156 lines
3.0 KiB
SCSS
Raw Normal View History

2023-01-12 14:54:24 -05:00
@use 'sass:math';
@use '../breakpoints';
@use '../functions';
2023-01-12 12:19:42 -06:00
2023-01-06 16:40:29 -05:00
.sl-l-grid {
&,
2023-01-09 14:10:02 -05:00
&--flex-columns > .sl-l-grid__column {
display: flex;
}
2023-01-06 16:40:29 -05:00
flex-wrap: wrap;
margin: 0;
padding: 0;
list-style: none;
2023-01-09 14:10:02 -05:00
&__column {
flex: 1;
}
2023-01-06 16:40:29 -05:00
}
2023-01-12 12:19:42 -06:00
@each $breakpoint, $size in breakpoints.$sl-breakpoints {
2023-01-06 16:40:29 -05:00
$prefix: if(($breakpoint == 'none'), '', '#{$breakpoint}-');
2023-01-12 12:19:42 -06:00
@include breakpoints.sl-breakpoint-set($breakpoint, $size) {
2023-01-06 16:40:29 -05:00
.sl-l-#{$prefix}grid {
2023-01-09 14:10:02 -05:00
&--top {
align-items: flex-start;
}
2023-01-06 16:40:29 -05:00
2023-01-09 14:10:02 -05:00
&--center {
align-items: center;
}
2023-01-06 16:40:29 -05:00
2023-01-09 14:10:02 -05:00
&--bottom {
align-items: flex-end;
}
2023-01-06 16:40:29 -05:00
2023-01-09 14:10:02 -05:00
&--stretch {
align-items: stretch;
}
2023-01-06 16:40:29 -05:00
2023-01-09 14:10:02 -05:00
&--baseline {
align-items: baseline;
}
2023-01-06 16:40:29 -05:00
&--justify {
2023-01-09 14:10:02 -05:00
&-left {
justify-content: flex-start;
}
2023-01-06 16:40:29 -05:00
2023-01-09 14:10:02 -05:00
&-center {
justify-content: center;
}
2023-01-06 16:40:29 -05:00
2023-01-09 14:10:02 -05:00
&-right {
justify-content: flex-end;
}
2023-01-06 16:40:29 -05:00
&-space {
2023-01-09 14:10:02 -05:00
&-between {
justify-content: space-between;
}
2023-01-06 16:40:29 -05:00
2023-01-09 14:10:02 -05:00
&-around {
justify-content: space-around;
}
2023-01-06 16:40:29 -05:00
2023-01-09 14:10:02 -05:00
&-evenly {
justify-content: space-evenly;
}
2023-01-06 16:40:29 -05:00
}
}
2023-01-09 14:10:02 -05:00
&--fit > .sl-l-grid__column {
flex: 1;
}
2023-01-06 16:40:29 -05:00
2023-01-09 14:10:02 -05:00
&--full > .sl-l-grid__column {
flex: 0 0 100%;
}
2023-01-06 16:40:29 -05:00
@for $i from 2 through 12 {
2023-01-09 14:10:02 -05:00
&--divide-by-#{$i} > .sl-l-grid__column {
2023-01-12 12:19:42 -06:00
flex: 0 0 math.div(100, $i) * 1%;
2023-01-09 14:10:02 -05:00
}
2023-01-06 16:40:29 -05:00
}
&__column {
2023-01-09 14:10:02 -05:00
&--top {
align-self: flex-start !important;
}
2023-01-06 16:40:29 -05:00
2023-01-09 14:10:02 -05:00
&--center {
align-self: center !important;
}
2023-01-06 16:40:29 -05:00
2023-01-09 14:10:02 -05:00
&--bottom {
align-self: flex-end !important;
}
2023-01-06 16:40:29 -05:00
2023-01-09 14:10:02 -05:00
&--baseline {
align-self: baseline !important;
}
2023-01-06 16:40:29 -05:00
2023-01-09 14:10:02 -05:00
&--stretch {
align-self: stretch !important;
}
2023-01-06 16:40:29 -05:00
2023-01-09 14:10:02 -05:00
&--auto-size {
flex: none !important;
}
2023-01-06 16:40:29 -05:00
@for $i from 1 through 11 {
2023-01-09 14:10:02 -05:00
&--#{$i}-of-12 {
2023-01-12 12:19:42 -06:00
width: math.div(100%, 12) * $i !important;
2023-01-09 14:10:02 -05:00
}
2023-01-06 16:40:29 -05:00
}
2023-01-09 14:10:02 -05:00
&--full {
width: 100% !important;
}
2023-01-06 16:40:29 -05:00
}
&--gutters {
2023-03-23 21:30:45 -05:00
margin-left: var(--sl-gutter--negative);
margin-right: var(--sl-gutter--negative);
2023-01-06 16:40:29 -05:00
> .sl-l-grid__column {
2023-03-23 21:30:45 -05:00
padding-left: var(--sl-gutter);
padding-right: var(--sl-gutter);
2023-01-06 16:40:29 -05:00
}
&-large {
2023-03-23 21:30:45 -05:00
margin-left: var(--sl-gutter--double-negative);
margin-right: var(--sl-gutter--double-negative);
2023-01-06 16:40:29 -05:00
> .sl-l-grid__column {
2023-03-23 21:30:45 -05:00
padding-left: var(--sl-gutter--double);
padding-right: var(--sl-gutter--double);
2023-01-06 16:40:29 -05:00
}
}
&-small {
2023-03-23 21:30:45 -05:00
margin-left: var(--sl-gutter--half-negative);
margin-right: var(--sl-gutter--half-negative);
2023-01-06 16:40:29 -05:00
> .sl-l-grid__column {
2023-03-23 21:30:45 -05:00
padding-left: var(--sl-gutter--half);
padding-right: var(--sl-gutter--half);
2023-01-06 16:40:29 -05:00
}
}
}
}
}
}