-
Notifications
You must be signed in to change notification settings - Fork 3
/
_processStructure.scss
72 lines (64 loc) · 2.61 KB
/
_processStructure.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
$a17-container-type: ();
$a17-column-count: ();
$a17-inner-gutters: ();
$a17-outer-gutters: ();
$a17-gutters: ();
$a17-breakpoints: ();
$a17-breakpoints-with-directions:();
$a17-smallest-breakpoint-name: 'xs';
/*
@mixin processStructure
Sets up the structural `:root` vars used by other utilities.
Most utilities point to these variables, either directly or within `calc()`'s.
These variables are then updated with media queries so the individual utilities
don't require their own media queries.
*/
@mixin processStructure() {
$a17-container-type: map-get($structure, 'container') !global;
$a17-column-count: map-get($structure, 'columns') !global;
$a17-gutters: (
'inner': map-deep-get($structure, 'gutters', 'inner'),
'outer': map-deep-get($structure, 'gutters', 'outer')
) !global;
$a17-breakpoints: process-breakpoints(map-get($structure, 'breakpoints')) !global;
$a17-breakpoints-with-directions: get-breakpoint-directions($a17-breakpoints) !global;
$a17-smallest-breakpoint-name: get-smallest-breakpoint(map-get($structure, 'breakpoints')) !global;
:root {
--safe-area-inset-bottom: 0px;
}
@supports (padding-top: constant(safe-area-inset-bottom)) {
:root {
--safe-area-inset-bottom: constant(safe-area-inset-bottom);
}
}
@supports (padding-top: env(safe-area-inset-bottom)) {
:root {
--safe-area-inset-bottom: env(safe-area-inset-bottom);
}
}
@each $name, $point in $a17-breakpoints {
@if ($name == $a17-smallest-breakpoint-name) {
$containerWidth: if(map-get($a17-container-type, $name) == 'auto', 'unset', map-get($a17-container-type, $name));
$outerGutter: if(map-deep-get($a17-gutters, 'outer', $name) == 'auto', '0px', map-deep-get($a17-gutters, 'outer', $name));
:root {
--breakpoint: '#{$name}';
--inner-gutter: #{map-deep-get($a17-gutters, 'inner', $name)};
--outer-gutter: #{$outerGutter};
--grid-columns: #{map-get($a17-column-count, $name)};
--container-width: #{$containerWidth};
}
} @else {
$containerWidth: if(map-get($a17-container-type, $name) == 'auto', 'unset', map-get($a17-container-type, $name));
$outerGutter: if(map-deep-get($a17-gutters, 'outer', $name) == 'auto', '0px', map-deep-get($a17-gutters, 'outer', $name));
@include breakpoint('#{$name}+') {
:root {
--breakpoint: '#{$name}';
--inner-gutter: #{map-deep-get($a17-gutters, 'inner', $name)};
--outer-gutter: #{$outerGutter};
--grid-columns: #{map-get($a17-column-count, $name)};
--container-width: #{$containerWidth};
}
}
}
}
}