-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_objects.flexlayout.scss
209 lines (147 loc) · 4.3 KB
/
_objects.flexlayout.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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
/* ==========================================================================
#FLEXBOX LAYOUT
---
NOTICE: Adapted from https://github.com/inuitcss/inuitcss/blob/develop/objects/_objects.layout.scss
========================================================================== */
/**
* Grid-like layout system.
*
* The layout object provides us with a column-style layout system. This file
* contains the basic structural elements, but classes should be complemented
* with width utilities, for example:
*
* <div class="o-layout">
* <div class="o-layout__item u-1/2">
* </div>
* <div class="o-layout__item u-1/2">
* </div>
* </div>
*
* The above will create a two-column structure in which each column will
* fluidly fill half of the width of the parent. We can have more complex
* systems:
*
* <div class="o-layout">
* <div class="o-layout__item u-1/1 u-1/3@medium">
* </div>
* <div class="o-layout__item u-1/2 u-1/3@medium">
* </div>
* <div class="o-layout__item u-1/2 u-1/3@medium">
* </div>
* </div>
*
* The above will create a system in which the first item will be 100% width
* until we enter our medium breakpoint, when it will become 33.333% width. The
* second and third items will be 50% of their parent, until they also become
* 33.333% width at the medium breakpoint.
*
* We can also manipulate entire layout systems by adding a series of modifiers
* to the `.o-layout` block. For example:
*
* <div class="o-layout o-layout--reverse">
*
* This will reverse the displayed order of the system so that it runs in the
* opposite order to our source, effectively flipping the system over.
*
* <div class="o-layout o-layout--[right|center]">
*
* This will cause the system to fill up from either the centre or the right
* hand side. Default behaviour is to fill up the layout system from the left.
*
* There are plenty more options available to us: explore them below.
*/
/* Default/mandatory classes.
========================================================================== */
/**
* 1. Allows us to use the layout object on any type of element.
* 2. We need to defensively reset any box-model properties.
* 3. Define flexbox settings to allow grid-like behaviour
* 4. Use the negative margin trick for multi-row grids:
*/
.o-layout {
display: flex; /* [3] */
align-items: stretch; /* [3] */
flex-wrap: wrap; /* [3] */
margin: 0; /* [2] */
padding: 0; /* [2] */
list-style: none; /* [1] */
margin: -$inuit-global-spacing-unit; /* [4] */
}
/**
* 1. By default, all layout items are full-width (mobile first).
* 2. Gutters provided by padding:
*/
.o-layout__item {
width: 100%; /* [1] */
padding: $inuit-global-spacing-unit
}
/* Gutter size modifiers.
========================================================================== */
.o-layout--tiny {
margin: -$inuit-global-spacing-unit-tiny;
> .o-layout__item {
padding: $inuit-global-spacing-unit-tiny;
}
}
.o-layout--small {
margin: -$inuit-global-spacing-unit-small;
> .o-layout__item {
padding: $inuit-global-spacing-unit-small;
}
}
.o-layout--large {
margin: -$inuit-global-spacing-unit-large;
> .o-layout__item {
padding: $inuit-global-spacing-unit-large;
}
}
.o-layout--huge {
margin: -$inuit-global-spacing-unit-huge;
> .o-layout__item {
padding: $inuit-global-spacing-unit-huge;
}
}
.o-layout--flush {
margin: 0;
> .o-layout__item {
padding: 0;
}
}
/* Vertical alignment modifiers.
========================================================================== */
/**
* Align all grid items to the middles of each other.
*/
.o-layout--middle {
> .o-layout__item {
align-self: center;
}
}
/**
* Align all grid items to the bottoms of each other.
*/
.o-layout--bottom {
> .o-layout__item {
align-self: flex-end;
}
}
/* Fill order modifiers.
========================================================================== */
/**
* Fill up the layout system from the centre.
*/
.o-layout--center {
justify-content: center;
}
/**
* Fill up the layout system from the right-hand side.
*/
.o-layout--right {
justify-content: flex-end;
}
/**
* Reverse the rendered order of the grid system.
*/
.o-layout--reverse {
flex-direction: row-reverse;
}