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

164 lines
2.9 KiB
SCSS
Raw Normal View History

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-09 20:10:02 +01:00
@each $breakpoint, $size in $sl-breakpoints {
2023-01-06 22:40:29 +01:00
$prefix: if(($breakpoint == 'none'), '', '#{$breakpoint}-');
2023-01-09 20:10:02 +01:00
@include 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 {
flex: 0 0 (100 / $i) * 1%;
}
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 {
width: (100% / 12) * $i !important;
}
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: {
right: -(sl-px-to-rem(16px));
left: -(sl-px-to-rem(16px));
2023-01-09 20:10:02 +01:00
}
2023-01-06 22:40:29 +01:00
> .sl-l-grid__column {
padding: {
right: sl-px-to-rem(16px);
left: sl-px-to-rem(16px);
2023-01-09 20:10:02 +01:00
}
2023-01-06 22:40:29 +01:00
}
&-large {
margin: {
right: -(sl-px-to-rem(32px));
left: -(sl-px-to-rem(32px));
2023-01-09 20:10:02 +01:00
}
2023-01-06 22:40:29 +01:00
> .sl-l-grid__column {
padding: {
right: sl-px-to-rem(32px);
left: sl-px-to-rem(32px);
2023-01-09 20:10:02 +01:00
}
2023-01-06 22:40:29 +01:00
}
}
&-small {
margin: {
right: -(sl-px-to-rem(8px));
left: -(sl-px-to-rem(8px));
2023-01-09 20:10:02 +01:00
}
2023-01-06 22:40:29 +01:00
> .sl-l-grid__column {
padding: {
right: sl-px-to-rem(8px);
left: sl-px-to-rem(8px);
2023-01-09 20:10:02 +01:00
}
2023-01-06 22:40:29 +01:00
}
}
}
}
}
}