forked from supple-kit/supple-css
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_index.scss
106 lines (85 loc) · 2.32 KB
/
_index.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
/* =========================================================================
objects.mesh
========================================================================= */
/* Use/Forward rules
`@use` or `@forward` everything you need here from other files.
These can include variables, mixins & other includes.
========================================================================= */
/**
* Forward the variables to the parent stylesheet
*/
@forward './variables';
/**
* Use the settings & tools in this sheet
*/
@use './variables';
@use '../../settings/defaults';
@use '../../tools/space';
@use '../../tools/rem';
@use '../../tools/responsive';
/* Internal variables
========================================================================= */
$selector: '> *';
@if (defaults.$css-modules) {
$selector: ':global(#{$selector})';
}
/* Module
========================================================================= */
/**
* Block: mesh
*
* 1. Account for browser defaults of elements that might be the root node of
* the component.
*/
.o-mesh {
--columns: #{variables.$columns};
--gap: 0;
--mesh-gap: var(--gap);
--block-gap: var(--mesh-gap);
--inline-gap: var(--mesh-gap);
display: grid;
grid-template-columns: repeat(var(--columns), 1fr);
gap: var(--block-gap) var(--inline-gap);
padding: 0; /* [1] */
margin-inline-start: 0; /* [1] */
list-style: none; /* [1] */
#{$selector} {
--colstart: 0;
--colspan: 1;
grid-column-start: var(--colstart);
grid-column-end: span var(--colspan);
}
}
/**
* Modifier: flow
* Fluid width columns that break into more or less columns as space is available, with no media queries
*/
.o-mesh--flow {
--min-inline-size: #{rem.convert(variables.$flow-min-inline-size)};
grid-template-columns: repeat(auto-fill, minmax(var(--min-inline-size), 1fr));
}
/**
* Modifier: dense
* Attempt to fill in holes earlier in the grid if smaller items come up later
*/
.o-mesh--dense {
grid-auto-flow: dense;
}
/**
* Modifier: gap-X
*/
@each $gap in variables.$gaps {
.o-mesh--gap-#{$gap} {
--mesh-gap: #{space.get($gap)};
}
}
/**
* Element modifier: row
* 1. Overwrite any previously set column start
*/
.o-mesh__row {
@include responsive.in-query(variables.$row-in-query) {
--colstart: 0; /* [1] */
--colspan: 12;
}
}