This repository has been archived by the owner on Jun 26, 2018. It is now read-only.
forked from chris-pearce/scally
-
Notifications
You must be signed in to change notification settings - Fork 1
/
_l-columns.scss
215 lines (162 loc) · 4.93 KB
/
_l-columns.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
210
211
212
213
214
215
/* ============================================================================
@LAYOUT -> COLUMNS
========================================================================= */
/**
* Easily create columns out of one element using CSS3 Columns.
*
* @markup
<div class="l-columns [modifier(s)]"> [...] </div>
*/
/**
* Settings.
*/
/**
* Apply at these breakpoints (turned off by default).
*/
$l-column-apply-at-breakpoints: $default-breakpoints !default;
// From the above breakpoints choose what you wish to apply it too
$l-column-apply-breakpoints-for-default: false !default;
$l-column-apply-breakpoints-for-columns-three: false !default;
$l-column-apply-breakpoints-for-columns-four: false !default;
$l-column-apply-breakpoints-for-columns-five: false !default;
$l-column-apply-breakpoints-for-columns-six: false !default;
$l-column-apply-breakpoints-for-gutter-tiny: false !default;
$l-column-apply-breakpoints-for-gutter-small: false !default;
$l-column-apply-breakpoints-for-gutter-large: false !default;
$l-column-apply-breakpoints-for-gutter-huge: false !default;
$l-column-apply-breakpoints-for-columns-divider: false !default;
/**
* Gutter sizes.
*/
$l-column-gap-base: $spacing-base !default;
$l-column-gap-tiny: $spacing-third !default;
$l-column-gap-small: $spacing-half !default;
$l-column-gap-large: $spacing-base-plus-half !default;
$l-column-gap-huge: $spacing-double !default;
/**
* Divider.
*/
$l-column-divider-thickness: 1 !default;
$l-column-divider-style: solid !default;
$l-column-divider-color: $color-text-base !default;
%l-columns,
.l-columns {
column-count: 2;
@include to-rem(column-gap, $l-column-gap-base);
}
@if $l-column-apply-breakpoints-for-default {
@include generate-at-breakpoints('.l-columns',
$l-column-apply-at-breakpoints) {
column-count: 2;
@include to-rem(column-gap, $l-column-gap-base);
}
}
/**
* Modifiers: number of columns.
*/
// Three
%l-columns--three,
.l-columns--three {
column-count: 3;
}
@if $l-column-apply-breakpoints-for-columns-three {
@include generate-at-breakpoints('.l-columns--three',
$l-column-apply-at-breakpoints) {
column-count: 3;
}
}
// Four
%l-columns--four,
.l-columns--four {
column-count: 4;
}
@if $l-column-apply-breakpoints-for-columns-four {
@include generate-at-breakpoints('.l-columns--four',
$l-column-apply-at-breakpoints) {
column-count: 4;
}
}
// Five
%l-columns--five,
.l-columns--five {
column-count: 5;
}
@if $l-column-apply-breakpoints-for-columns-five {
@include generate-at-breakpoints('.l-columns--five',
$l-column-apply-at-breakpoints) {
column-count: 5;
}
}
// Six
%l-columns--six,
.l-columns--six {
column-count: 6;
}
@if $l-column-apply-breakpoints-for-columns-six {
@include generate-at-breakpoints('.l-columns--six',
$l-column-apply-at-breakpoints) {
column-count: 6;
}
}
/**
* Modifiers: gutter sizes.
*/
// Tiny
%l-columns--gutter-tiny,
.l-columns--gutter-tiny {
@include to-rem(column-gap, $l-column-gap-tiny);
}
@if $l-column-apply-breakpoints-for-gutter-tiny {
@include generate-at-breakpoints('.l-columns--gutter-tiny',
$l-column-apply-at-breakpoints) {
@include to-rem(column-gap, $l-column-gap-tiny);
}
}
// Small
%l-columns--gutter-small,
.l-columns--gutter-small {
@include to-rem(column-gap, $l-column-gap-small);
}
@if $l-column-apply-breakpoints-for-gutter-small {
@include generate-at-breakpoints('.l-columns--gutter-small',
$l-column-apply-at-breakpoints) {
@include to-rem(column-gap, $l-column-gap-small);
}
}
// Large
%l-columns--gutter-large,
.l-columns--gutter-large {
@include to-rem(column-gap, $l-column-gap-large);
}
@if $l-column-apply-breakpoints-for-gutter-large {
@include generate-at-breakpoints('.l-columns--gutter-large',
$l-column-apply-at-breakpoints) {
@include to-rem(column-gap, $l-column-gap-large);
}
}
// Huge
%l-columns--gutter-huge,
.l-columns--gutter-huge {
@include to-rem(column-gap, $l-column-gap-huge);
}
@if $l-column-apply-breakpoints-for-gutter-huge {
@include generate-at-breakpoints('.l-columns--gutter-huge',
$l-column-apply-at-breakpoints) {
@include to-rem(column-gap, $l-column-gap-huge);
}
}
/**
* Modifier: column divider.
*/
%l-columns--divider,
.l-columns--divider {
column-rule: strip-unit($l-column-divider-thickness) * 1px
$l-column-divider-style $l-column-divider-color;
}
@if $l-column-apply-breakpoints-for-columns-divider {
@include generate-at-breakpoints('.l-columns--divider',
$l-column-apply-at-breakpoints) {
column-rule: strip-unit($l-column-divider-thickness) * 1px
$l-column-divider-style $l-column-divider-color;
}
}