-
Notifications
You must be signed in to change notification settings - Fork 0
/
_auk-o-grid.scss
165 lines (121 loc) · 3.87 KB
/
_auk-o-grid.scss
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
@use "auk-table";
@use "tools/t-mixins";
@use "settings";
/* ==========================================================================
Grid
---
Basic grid system
@brenner-company (Karel Persoons): Some styling (regarding col-start & -end) is commented out for the moment because I'm not sure this is necessary at all and it generates a quite few extra Kilobytes.
========================================================================== */
$o-grid-columns: 12 !default;
$o-grid-column-gap: 1.5rem !default;
/* Grid columns (default)
========================================================================== */
.auk-o-grid {
display: grid;
gap: $o-grid-column-gap;
}
.auk-o-grid {
grid-template-columns: repeat($o-grid-columns, 1fr);
> * {
grid-column: span var(--auk-o-grid-col-span, $o-grid-columns) / span var(--auk-o-grid-col-span, $o-grid-columns);
}
}
@for $i from 1 through $o-grid-columns {
.auk-o-grid-col-#{auk-table.$i} {
--auk-o-grid-col-span: #{auk-table.$i};
}
// .auk-o-grid-col-start-#{$i} {
// grid-column-start: #{$i};
// }
// .auk-o-grid-col-end-#{$i+1} {
// grid-column-end: #{$i+1};
// }
}
.auk-o-grid-col-start {
grid-column-start: 1;
}
.auk-o-grid-col-end {
grid-column-end: -1;
}
/* Automatic grid columns
========================================================================== */
.auk-o-grid-auto {
display: grid;
gap: $o-grid-column-gap;
}
.auk-o-grid-auto {
grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
}
[class*="auk-o-grid-auto--"] {
grid-template-columns: repeat(auto-fit, minmax(var(--auk-o-grid-col-min-width), 1fr));
}
.auk-o-grid-auto--min-width-xsmall {
--auk-o-grid-col-min-width: 8rem;
}
.auk-o-grid-auto--min-width-small {
--auk-o-grid-col-min-width: 10rem;
}
.auk-o-grid-auto--min-width-medium {
--auk-o-grid-col-min-width: 15rem;
}
.auk-o-grid-auto--min-width-large {
--auk-o-grid-col-min-width: 20rem;
}
.auk-o-grid-auto--min-width-xlarge {
--auk-o-grid-col-min-width: 25rem;
}
/* Breakpoints
========================================================================== */
@each $breakpoint, $width in settings.$global-breakpoints {
@include t-mixins.breakpoint($breakpoint) {
@for $i from 1 through $o-grid-columns {
.auk-o-grid-col-#{auk-table.$i}\@#{$breakpoint} {
--auk-o-grid-col-span: #{auk-table.$i};
}
// .auk-o-grid-col-start-#{$i}\@#{$breakpoint} {
// grid-column-start: #{$i};
// }
// .auk-o-grid-col-end-#{$i+1}\@#{$breakpoint} {
// grid-column-end: #{$i+1};
// }
}
.auk-o-grid-auto\@#{$breakpoint} { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }
.auk-o-grid-auto--min-width-xsmall\@#{$breakpoint} {
--auk-o-grid-col-min-width: 8rem;
}
.auk-o-grid-auto--min-width-small\@#{$breakpoint} {
--auk-o-grid-col-min-width: 10rem;
}
.auk-o-grid-auto--min-width-medium\@#{$breakpoint} {
--auk-o-grid-col-min-width: 15rem;
}
.auk-o-grid-auto--min-width-large\@#{$breakpoint} {
--auk-o-grid-col-min-width: 20rem;
}
.auk-o-grid-auto--min-width-xlarge\@#{$breakpoint} {
--auk-o-grid-col-min-width: 25rem;
}
// .auk-o-grid-col-start\@#{$breakpoint} { grid-column-start: 1; }
// .auk-o-grid-col-end\@#{$breakpoint} { grid-column-end: -1; }
// .auk-o-grid-col-start-auto\@#{$breakpoint} { grid-column-start: auto; }
// .auk-o-grid-col-end-auto\@#{$breakpoint} { grid-column-end: auto; }
}
}
/* Grid columns (modifiers)
========================================================================== */
.auk-o-grid--no-gutter {
gap: 0;
}
.auk-o-grid--vertical-center {
align-items: center !important;
}
.auk-o-grid--align-start {
align-items: start !important;
}
.auk-o-grid--align-end {
align-items: end !important;
}
.auk-o-grid--align-baseline {
align-items: baseline !important;
}