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

169 lines
3.1 KiB
SCSS
Raw Normal View History

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