garth-jekyll-theme 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,282 @@
1
+ // Layouts
2
+ // ---------------------------------------
3
+
4
+ // Container.
5
+ .section {
6
+ @include clearfix;
7
+
8
+ margin: 0 auto;
9
+ position: relative;
10
+ width: 94%;
11
+
12
+ @include breakpoint(break-3) {
13
+ @include maxwidth(3);
14
+ }
15
+
16
+ @include breakpoint(break-4) {
17
+ @include maxwidth(4);
18
+ }
19
+ }
20
+
21
+ // Single column (based on measure for typeset content).
22
+ .single-measure {
23
+ @include measure(all);
24
+
25
+ margin: 0 auto;
26
+ }
27
+
28
+ // Base column styles.
29
+ .column {
30
+ @include measure(0);
31
+
32
+ margin: 0 auto;
33
+ width: 100%;
34
+
35
+ @include breakpoint(break-1) {
36
+ float: left;
37
+ margin: initial;
38
+ max-width: initial;
39
+ padding-left: map-get($gutterwidths, small);
40
+ padding-right: map-get($gutterwidths, small);
41
+ }
42
+
43
+ @include breakpoint(break-3) {
44
+ padding-left: map-get($gutterwidths, medium);
45
+ padding-right: map-get($gutterwidths, medium);
46
+ }
47
+ }
48
+
49
+ // Two columns.
50
+ .column--duo {
51
+
52
+ @include breakpoint(break-1) {
53
+ width: 50%;
54
+
55
+ &:nth-of-type(2n+3) {
56
+ clear: left;
57
+ }
58
+
59
+ &:nth-of-type(n+3) {
60
+ margin-top: 3rem;
61
+ }
62
+ }
63
+ }
64
+
65
+ // Three columns.
66
+ .column--trio {
67
+
68
+ @include breakpoint(break-1) {
69
+ width: 33.333%;
70
+
71
+ &:nth-of-type(3n+4) {
72
+ clear: left;
73
+ }
74
+
75
+ &:nth-of-type(n+4) {
76
+ margin-top: 3rem;
77
+ }
78
+ }
79
+ }
80
+
81
+ // Four columns. Two at smaller breakpoints.
82
+ .column--quad {
83
+
84
+ @include breakpoint(break-1) {
85
+ width: 50%;
86
+ }
87
+
88
+ @include breakpoint(break-2) {
89
+ width: 25%;
90
+ }
91
+ }
92
+
93
+ // Two column layout with a main text column and a sidebar.
94
+
95
+ // Main column.
96
+ .column--main {
97
+
98
+ @include breakpoint(break-1) {
99
+ @include ideal-measure(1, small);
100
+ }
101
+
102
+ @include breakpoint(break-2) {
103
+ @include ideal-measure(2, small);
104
+ }
105
+
106
+ @include breakpoint(break-3) {
107
+ @include ideal-measure(3, medium);
108
+ }
109
+
110
+ @include breakpoint(break-4) {
111
+ @include ideal-measure(4, medium);
112
+ }
113
+ }
114
+
115
+ // Sidebar.
116
+ .column--sidebar {
117
+
118
+ @include breakpoint(break-1) {
119
+ @include ideal-measure(1, small, false);
120
+
121
+ padding-right: map-get($gutterwidths, medium);
122
+ }
123
+
124
+ @include breakpoint(break-2) {
125
+ @include ideal-measure(2, small, false);
126
+ }
127
+
128
+ @include breakpoint(break-3) {
129
+ @include ideal-measure(3, medium, false);
130
+
131
+ padding-right: map-get($gutterwidths, large);
132
+ }
133
+
134
+ @include breakpoint(break-4) {
135
+ @include ideal-measure(4, medium, false);
136
+ }
137
+ }
138
+
139
+ // If sidebar on the right side.
140
+ .column--main + .column--sidebar {
141
+ @include breakpoint(break-1) {
142
+ padding-left: map-get($gutterwidths, medium);
143
+ padding-right: map-get($gutterwidths, small);
144
+ }
145
+
146
+ @include breakpoint(break-3) {
147
+ padding-left: map-get($gutterwidths, large);
148
+ padding-right: map-get($gutterwidths, medium);
149
+ }
150
+ }
151
+
152
+ // Set the main text one level down in the modular scale for narrower columns.
153
+ .column--trio,
154
+ .column--quad,
155
+ .column--sidebar {
156
+
157
+ @include breakpoint(break-3) {
158
+
159
+ p {
160
+ @include sassline($fontsize: eta, $font: $bodytype, $lineheight: 2, $below: 2, $breakpoint: 3);
161
+ }
162
+
163
+ li {
164
+ @include fontsize(eta, 3);
165
+ }
166
+ }
167
+
168
+ @include breakpoint(break-4) {
169
+
170
+ p {
171
+ @include sassline($fontsize: eta, $font: $bodytype, $lineheight: 2, $below: 2, $breakpoint: 4);
172
+ }
173
+
174
+ li {
175
+ @include fontsize(eta, 4);
176
+ }
177
+ }
178
+ }
179
+
180
+ // Main column on the right with inline sidenotes.
181
+ // The sidenotes will move out the column into the sidebar position aligned to the baseline.
182
+ .column--right {
183
+
184
+ @include breakpoint(break-1) {
185
+ @include ideal-measure(1, small);
186
+ @include ideal-measure(1, small, false, margin-left);
187
+ }
188
+
189
+ @include breakpoint(break-2) {
190
+ @include ideal-measure(2, small);
191
+ @include ideal-measure(2, small, false, margin-left);
192
+ }
193
+
194
+ @include breakpoint(break-3) {
195
+ @include ideal-measure(3, medium);
196
+ @include ideal-measure(3, medium, false, margin-left);
197
+ }
198
+
199
+ @include breakpoint(break-4) {
200
+ @include ideal-measure(4, medium);
201
+ @include ideal-measure(4, medium, false, margin-left);
202
+ }
203
+
204
+ .sidenote {
205
+
206
+ @include breakpoint(break-1) {
207
+ @include ideal-measure(1, small, false);
208
+
209
+ left: 0;
210
+ padding-left: map-get($gutterwidths, small);
211
+ padding-right: map-get($gutterwidths, medium);
212
+ position: absolute;
213
+ }
214
+
215
+ @include breakpoint(break-2) {
216
+ @include ideal-measure(2, small, false);
217
+ }
218
+
219
+ @include breakpoint(break-3) {
220
+ @include ideal-measure(3, medium, false);
221
+
222
+ padding-right: map-get($gutterwidths, large);
223
+ }
224
+
225
+ @include breakpoint(break-4) {
226
+ @include ideal-measure(4, medium, false);
227
+
228
+ padding-left: map-get($gutterwidths, medium);
229
+ }
230
+ }
231
+ }
232
+
233
+ // Main column on the left with inline sidenotes.
234
+ .column--left {
235
+
236
+ @include breakpoint(break-1) {
237
+ @include ideal-measure(1, small);
238
+ }
239
+
240
+ @include breakpoint(break-2) {
241
+ @include ideal-measure(2, small);
242
+ }
243
+
244
+ @include breakpoint(break-3) {
245
+ @include ideal-measure(3, medium);
246
+ }
247
+
248
+ @include breakpoint(break-4) {
249
+ @include ideal-measure(4, medium);
250
+ }
251
+
252
+ .sidenote {
253
+
254
+ @include breakpoint(break-1) {
255
+ @include ideal-measure(1, small, false);
256
+ @include ideal-measure(1, small, true, left);
257
+
258
+ padding-left: map-get($gutterwidths, medium);
259
+ padding-right: map-get($gutterwidths, small);
260
+ position: absolute;
261
+ }
262
+
263
+ @include breakpoint(break-2) {
264
+ @include ideal-measure(2, small, false);
265
+ @include ideal-measure(2, small, true, left);
266
+ }
267
+
268
+ @include breakpoint(break-3) {
269
+ @include ideal-measure(3, medium, false);
270
+ @include ideal-measure(3, medium, true, left);
271
+
272
+ padding-left: map-get($gutterwidths, large);
273
+ }
274
+
275
+ @include breakpoint(break-4) {
276
+ @include ideal-measure(4, medium, false);
277
+ @include ideal-measure(4, medium, true, left);
278
+
279
+ padding-right: map-get($gutterwidths, medium);
280
+ }
281
+ }
282
+ }
@@ -0,0 +1,420 @@
1
+ // SCSS mixins
2
+ // ---------------------------------------
3
+
4
+ // Global variables used in mixins.
5
+
6
+ // Number of breakpoints.
7
+ $breakpoints-limit: length($breakpoints);
8
+
9
+ // List of rootsizes, breakpoints, and max-widths.
10
+ $sizes: map-values($rootsizes);
11
+ $points: map-values($breakpoints);
12
+ $line-widths: map-values($measures);
13
+ $max-widths: map-values($maxwidths);
14
+
15
+
16
+ // Breakpoints. Either set one to one of the breakpoint variables, or use a custom value for minor breakpoints.
17
+ // Defaults to min-width, but both min->max and max-width are available too.
18
+ // Parts based on https://gist.github.com/timknight/03e6335b8816aa534cf7
19
+ @mixin breakpoint($break: 0, $max: 0) {
20
+ // Type of break variable
21
+ $value: type-of($break);
22
+
23
+ // If it is a string (i.e. a breakpoint variable).
24
+ @if $value == string {
25
+ // If using 'break-1', 'break-2' etc output the correct breakpoints from map.
26
+ @if map-has-key($breakpoints, $break) {
27
+ @media screen and (min-width: #{map-get($breakpoints, $break) / 16 * 1em} ) { @content; }
28
+ } @else {
29
+ @warn "#{$break} is not a set breakpoint variable";
30
+ }
31
+
32
+ // If it is a number, use this for the breakpoint.
33
+ } @else if $value == number {
34
+ // If using other numbers output value in ems either for min, min & max or max width breakpoints.
35
+ $query: "all" !default;
36
+ @if $break != 0 and $max != 0 { $query: "(min-width: #{$break / 16 * 1em}) and (max-width: #{$max / 16 * 1em})"; }
37
+ @else if $break != 0 and $max == 0 { $query: "(min-width: #{$break / 16 * 1em})"; }
38
+ @else if $break == 0 and $max != 0 { $query: "(max-width: #{$max / 16 * 1em})"; }
39
+ @media #{$query} { @content; }
40
+
41
+ } @else {
42
+ @warn "#{$break} is not valid to use as a breakpoint";
43
+ }
44
+ }
45
+
46
+ // Root font-size in %, outputted in correct breakpoints.
47
+ @mixin rootsize {
48
+ font-size: nth($sizes, 1) / 16 * 100%;
49
+
50
+ // Loop through breakpoints.
51
+ @for $i from 2 through $breakpoints-limit {
52
+ @media screen and (min-width: nth($points, $i) / 16 * 1em ) {
53
+ font-size: nth($sizes, $i) / 16 * 100%;
54
+ }
55
+ }
56
+ }
57
+
58
+ // Max-widths for typeset containers, outputted in correct breakpoints.
59
+ @mixin maxwidth($breakpoint: 0) {
60
+ // Type of chosen variables.
61
+ $break-value: type-of($breakpoint);
62
+
63
+ // If specifying a breakpoint to use (and breakpoint exists).
64
+ @if $break-value == number and $breakpoint <= ($breakpoints-limit - 1) and $breakpoint >= 0 {
65
+
66
+ max-width: #{nth($max-widths, ($breakpoint + 1)) / nth($sizes, ($breakpoint + 1))}rem;
67
+
68
+ } @else if $breakpoint == all {
69
+ max-width: #{nth($max-widths, 1) / nth($sizes, 1)}rem;
70
+
71
+ // Loop through breakpoints.
72
+ @for $i from 2 through $breakpoints-limit {
73
+ @media screen and (min-width: nth($points, $i) / 16 * 1em ) {
74
+ max-width: #{nth($max-widths, $i) / nth($sizes, $i)}rem;
75
+ }
76
+ }
77
+ }
78
+ }
79
+
80
+ // Set the measure for single columns, outputted in correct breakpoints.
81
+ @mixin measure($breakpoint: 0) {
82
+ // Type of chosen variables.
83
+ $break-value: type-of($breakpoint);
84
+
85
+ // If specifying a breakpoint to use (and breakpoint exists).
86
+ @if $break-value == number and $breakpoint <= ($breakpoints-limit - 1) and $breakpoint >= 0 {
87
+
88
+ max-width: #{nth($line-widths, ($breakpoint + 1)) / nth($sizes, ($breakpoint + 1))}rem;
89
+
90
+ } @else if $breakpoint == all {
91
+ max-width: #{nth($line-widths, 1) / nth($sizes, 1)}rem;
92
+
93
+ // Loop through breakpoints.
94
+ @for $i from 2 through $breakpoints-limit {
95
+ @media screen and (min-width: nth($points, $i) / 16 * 1em ) {
96
+ max-width: #{nth($line-widths, $i) / nth($sizes, $i)}rem;
97
+ }
98
+ }
99
+ }
100
+ }
101
+
102
+ // Calculate percentage width of container to get optimal measure for main text columns.
103
+ // Defaults to all breakpoints.
104
+ // Note: will not output for base breakpoint as this comes from the 'measure' mixin.
105
+ @mixin ideal-measure($breakpoint: 0, $gutter: 0, $main: true, $output: max-width) {
106
+ // Type of chosen variables.
107
+ $break-value: type-of($breakpoint);
108
+
109
+ // If specifying a breakpoint to use (and breakpoint exists and is larger than 0).
110
+ @if $break-value == number and $breakpoint <= ($breakpoints-limit - 1) and $breakpoint > 0 {
111
+
112
+ @if $gutter == small {
113
+ $gutter: map-get($gutterwidths, small) * 2 / 1rem;
114
+ } @else if $gutter == medium {
115
+ $gutter: map-get($gutterwidths, medium) * 2 / 1rem;
116
+ } @else if $gutter == large {
117
+ $gutter: map-get($gutterwidths, large) * 2 / 1rem;
118
+ } @else {
119
+ $gutter: 0;
120
+ }
121
+
122
+ $rootsize: map-get($rootsizes, rootsize-#{$breakpoint});
123
+ $ideal-measure: map-get($measures, measure-#{$breakpoint});
124
+ $gutter-size: ($gutter * $rootsize);
125
+ $container-width: map-get($maxwidths, width-#{$breakpoint});
126
+
127
+ $percentage: percentage(($ideal-measure + $gutter-size) / $container-width);
128
+
129
+ @if $percentage < 55 {
130
+ $percentage: 55%;
131
+ } @else if $percentage > 65 {
132
+ $percentage: 65%;
133
+ }
134
+
135
+ @if $main == false {
136
+ $percentage: 100 - $percentage;
137
+ }
138
+
139
+ #{$output}: $percentage;
140
+ }
141
+ }
142
+
143
+ // Value in scale in $modular-scale?
144
+ // Used in following fontsize mixin.
145
+ @function in-modular-scale($scale, $key) {
146
+ $map: map-get($modular-scale, $scale);
147
+ $output: map-has-key($map, $key);
148
+ @return $output;
149
+ }
150
+
151
+ // Font-size in rems. Either set per breakpoint or for all.
152
+ // Use values as you would for pixels i.e. 16 or use values from the modular scale.
153
+ @mixin fontsize($fontsize, $breakpoint: 0) {
154
+ // Type of chosen variables.
155
+ $font-value: type-of($fontsize);
156
+ $break-value: type-of($breakpoint);
157
+
158
+ // Check if value exists in scale.
159
+ $in-scale: in-modular-scale(scale-0, $fontsize);
160
+
161
+ // If specifying a breakpoint to use (and breakpoint exists).
162
+ @if $break-value == number and $breakpoint <= ($breakpoints-limit - 1) and $breakpoint >= 0 {
163
+
164
+ // If using a number for fontsize.
165
+ @if $font-value == number {
166
+ font-size: #{$fontsize / nth($sizes, ($breakpoint + 1))}rem;
167
+
168
+ // If using a variable from the scale for fontsize.
169
+ } @else if $in-scale == true {
170
+ $get-scale: map-get($modular-scale, scale-#{$breakpoint});
171
+ $get-size: map-get($get-scale, $fontsize);
172
+
173
+ font-size: #{$get-size / nth($sizes, ($breakpoint + 1))}rem;
174
+
175
+ } @else {
176
+ @warn "#{$fontsize} is not a valid scale variable";
177
+ }
178
+
179
+ // If want to use value for all breakpoints.
180
+ } @else if $breakpoint == all {
181
+
182
+ // If using a number for fontsize.
183
+ @if $font-value == number {
184
+ font-size: #{$fontsize / nth($sizes, 1)}rem;
185
+
186
+ // Loop through breakpoints.
187
+ @for $i from 2 through $breakpoints-limit {
188
+ @media screen and (min-width: nth($points, $i) / 16 * 1em ) {
189
+ font-size: #{$fontsize / nth($sizes, $i)}rem;
190
+ }
191
+ }
192
+
193
+ // If using a variable from the scale for fontsize.
194
+ } @else if $in-scale == true {
195
+ $get-scale: map-get($modular-scale, scale-0);
196
+ $get-size: map-get($get-scale, $fontsize);
197
+ font-size: #{$get-size / nth($sizes, 1)}rem;
198
+
199
+ // Loop through breakpoints.
200
+ @for $i from 2 through $breakpoints-limit {
201
+ $get-scale: map-get($modular-scale, scale-#{$i - 1});
202
+ $get-size: map-get($get-scale, $fontsize);
203
+
204
+ @media screen and (min-width: nth($points, $i) / 16 * 1em ) {
205
+ font-size: #{$get-size / nth($sizes, $i)}rem;
206
+ }
207
+ }
208
+
209
+ } @else {
210
+ @warn "#{$fontsize} is not a valid scale variable";
211
+ }
212
+
213
+ } @else {
214
+ @warn "#{$breakpoint} is not valid to use as a breakpoint";
215
+ }
216
+ }
217
+
218
+ // Advanced baseline magic.
219
+ // ! Read the README to help understand what is going on here.
220
+ // Parts based on https://gist.github.com/razwan/10662500
221
+ @mixin baseline($fontsize, $font, $lineheight: 2, $below: 2, $breakpoint: 0) {
222
+ // Type of chosen variables.
223
+ $font-value: type-of($fontsize);
224
+ $break-value: type-of($breakpoint);
225
+
226
+ // Cap height
227
+ $cap-height: map-get($font, cap-height);
228
+
229
+ // Check if value exists in scale.
230
+ $in-scale: in-modular-scale(scale-0, $fontsize);
231
+
232
+ // Set the line-height (if it isn’t set at 0).
233
+ @if $lineheight != 0 {
234
+ line-height: #{$lineheight}rem;
235
+ }
236
+
237
+ // If specifying a breakpoint to use (and breakpoint exists).
238
+ @if $break-value == number and $breakpoint <= ($breakpoints-limit - 1) and $breakpoint >= 0 {
239
+
240
+ // If using a number for fontsize.
241
+ @if $font-value == number {
242
+ $rootsize: nth($sizes, ($breakpoint + 1));
243
+ $baseline-shift: #{($fontsize / 2 * (($lineheight * $rootsize / $fontsize) - $cap-height)) / $rootsize + 0.00001};
244
+ $baseline-push: #{$below - (($fontsize / 2 * (($lineheight * $rootsize / $fontsize) - $cap-height)) / $rootsize + 0.00001)};
245
+
246
+ margin-bottom: #{$baseline-push}rem;
247
+ padding-top: #{$baseline-shift}rem;
248
+
249
+ // If using a variable from the scale for fontsize.
250
+ } @else if $in-scale == true {
251
+ $get-scale: map-get($modular-scale, scale-#{$breakpoint});
252
+ $get-size: map-get($get-scale, $fontsize);
253
+ $rootsize: nth($sizes, ($breakpoint + 1));
254
+
255
+ $baseline-shift: #{($get-size / 2 * (($lineheight * $rootsize / $get-size) - $cap-height)) / $rootsize + 0.00001};
256
+ $baseline-push: #{$below - (($get-size / 2 * (($lineheight * $rootsize / $get-size) - $cap-height)) / $rootsize + 0.00001)};
257
+
258
+ margin-bottom: #{$baseline-push}rem;
259
+ padding-top: #{$baseline-shift}rem;
260
+
261
+ } @else {
262
+ @warn "#{$fontsize} is not a valid scale variable";
263
+ }
264
+
265
+ // If want to use value for all breakpoints.
266
+ } @else if $breakpoint == all {
267
+
268
+ // If using a number for fontsize.
269
+ @if $font-value == number {
270
+ $rootsize: nth($sizes, 1);
271
+ $baseline-shift: #{($fontsize / 2 * (($lineheight * $rootsize / $fontsize) - $cap-height)) / $rootsize + 0.00001};
272
+ $baseline-push: #{$below - (($fontsize / 2 * (($lineheight * $rootsize / $fontsize) - $cap-height)) / $rootsize + 0.00001)};
273
+
274
+ margin-bottom: #{$baseline-push}rem;
275
+ padding-top: #{$baseline-shift}rem;
276
+
277
+ // Loop through breakpoints.
278
+ @for $i from 2 through $breakpoints-limit {
279
+ $rootsize: nth($sizes, $i);
280
+ $baseline-shift: #{($fontsize / 2 * (($lineheight * $rootsize / $fontsize) - $cap-height)) / $rootsize + 0.00001};
281
+ $baseline-push: #{$below - (($fontsize / 2 * (($lineheight * $rootsize / $fontsize) - $cap-height)) / $rootsize + 0.00001)};
282
+
283
+ @media screen and (min-width: nth($points, $i) / 16 * 1em ) {
284
+ margin-bottom: #{$baseline-push}rem;
285
+ padding-top: #{$baseline-shift}rem;
286
+ }
287
+ }
288
+
289
+ // If using a variable from the scale for fontsize.
290
+ } @else if $in-scale == true {
291
+ $get-scale: map-get($modular-scale, scale-0);
292
+ $get-size: map-get($get-scale, $fontsize);
293
+ $rootsize: nth($sizes, 1);
294
+
295
+ $baseline-shift: #{($get-size / 2 * (($lineheight * $rootsize / $get-size) - $cap-height)) / $rootsize + 0.00001};
296
+ $baseline-push: #{$below - (($get-size / 2 * (($lineheight * $rootsize / $get-size) - $cap-height)) / $rootsize + 0.00001)};
297
+
298
+ margin-bottom: #{$baseline-push}rem;
299
+ padding-top: #{$baseline-shift}rem;
300
+
301
+ // Loop through breakpoints.
302
+ @for $i from 2 through $breakpoints-limit {
303
+ $get-scale: map-get($modular-scale, scale-#{$i - 1});
304
+ $get-size: map-get($get-scale, $fontsize);
305
+ $rootsize: nth($sizes, $i);
306
+
307
+ $baseline-shift: #{($get-size / 2 * (($lineheight * $rootsize / $get-size) - $cap-height)) / $rootsize + 0.00001};
308
+ $baseline-push: #{$below - (($get-size / 2 * (($lineheight * $rootsize / $get-size) - $cap-height)) / $rootsize + 0.00001)};
309
+
310
+ @media screen and (min-width: nth($points, $i) / 16 * 1em ) {
311
+ margin-bottom: #{$baseline-push}rem;
312
+ padding-top: #{$baseline-shift}rem;
313
+ }
314
+ }
315
+
316
+ } @else {
317
+ @warn "#{$fontsize} is not a valid scale variable";
318
+ }
319
+
320
+ } @else {
321
+ @warn "#{$breakpoint} is not valid to use as a breakpoint";
322
+ }
323
+ }
324
+
325
+ // Set fontsize and baseline at once. Mix of fontsize and baseline mixin.
326
+ @mixin sassline($fontsize, $font, $lineheight: 2, $below: 2, $breakpoint: 0) {
327
+ $font-value: type-of($fontsize);
328
+ $break-value: type-of($breakpoint);
329
+ $cap-height: map-get($font, cap-height);
330
+ $in-scale: in-modular-scale(scale-0, $fontsize);
331
+
332
+ line-height: #{$lineheight}rem;
333
+
334
+ @if $break-value == number and $breakpoint <= ($breakpoints-limit - 1) and $breakpoint >= 0 {
335
+
336
+ @if $font-value == number {
337
+ $rootsize: nth($sizes, ($breakpoint + 1));
338
+ $baseline-shift: #{($fontsize / 2 * (($lineheight * $rootsize / $fontsize) - $cap-height)) / $rootsize + 0.00001};
339
+ $baseline-push: #{$below - (($fontsize / 2 * (($lineheight * $rootsize / $fontsize) - $cap-height)) / $rootsize + 0.00001)};
340
+ font-size: #{$fontsize / nth($sizes, ($breakpoint + 1))}rem;
341
+ margin-bottom: #{$baseline-push}rem;
342
+ padding-top: #{$baseline-shift}rem;
343
+
344
+ } @else if $in-scale == true {
345
+ $get-scale: map-get($modular-scale, scale-#{$breakpoint});
346
+ $get-size: map-get($get-scale, $fontsize);
347
+ $rootsize: nth($sizes, ($breakpoint + 1));
348
+ $baseline-shift: #{($get-size / 2 * (($lineheight * $rootsize / $get-size) - $cap-height)) / $rootsize + 0.00001};
349
+ $baseline-push: #{$below - (($get-size / 2 * (($lineheight * $rootsize / $get-size) - $cap-height)) / $rootsize + 0.00001)};
350
+ font-size: #{$get-size / nth($sizes, ($breakpoint + 1))}rem;
351
+ margin-bottom: #{$baseline-push}rem;
352
+ padding-top: #{$baseline-shift}rem;
353
+
354
+ } @else {
355
+ @warn "#{$fontsize} is not a valid scale variable";
356
+ }
357
+
358
+ } @else if $breakpoint == all {
359
+
360
+ @if $font-value == number {
361
+ $rootsize: nth($sizes, 1);
362
+ $baseline-shift: #{($fontsize / 2 * (($lineheight * $rootsize / $fontsize) - $cap-height)) / $rootsize + 0.00001};
363
+ $baseline-push: #{$below - (($fontsize / 2 * (($lineheight * $rootsize / $fontsize) - $cap-height)) / $rootsize + 0.00001)};
364
+ font-size: #{$fontsize / nth($sizes, 1)}rem;
365
+ margin-bottom: #{$baseline-push}rem;
366
+ padding-top: #{$baseline-shift}rem;
367
+
368
+ @for $i from 2 through $breakpoints-limit {
369
+ $rootsize: nth($sizes, $i);
370
+ $baseline-shift: #{($fontsize / 2 * (($lineheight * $rootsize / $fontsize) - $cap-height)) / $rootsize + 0.00001};
371
+ $baseline-push: #{$below - (($fontsize / 2 * (($lineheight * $rootsize / $fontsize) - $cap-height)) / $rootsize + 0.00001)};
372
+ @media screen and (min-width: nth($points, $i) / 16 * 1em ) {
373
+ font-size: #{$fontsize / nth($sizes, $i)}rem;
374
+ margin-bottom: #{$baseline-push}rem;
375
+ padding-top: #{$baseline-shift}rem;
376
+ }
377
+ }
378
+
379
+ } @else if $in-scale == true {
380
+ $get-scale: map-get($modular-scale, scale-0);
381
+ $get-size: map-get($get-scale, $fontsize);
382
+ $rootsize: nth($sizes, 1);
383
+ $baseline-shift: #{($get-size / 2 * (($lineheight * $rootsize / $get-size) - $cap-height)) / $rootsize + 0.00001};
384
+ $baseline-push: #{$below - (($get-size / 2 * (($lineheight * $rootsize / $get-size) - $cap-height)) / $rootsize + 0.00001)};
385
+ font-size: #{$get-size / nth($sizes, 1)}rem;
386
+ margin-bottom: #{$baseline-push}rem;
387
+ padding-top: #{$baseline-shift}rem;
388
+
389
+ @for $i from 2 through $breakpoints-limit {
390
+ $get-scale: map-get($modular-scale, scale-#{$i - 1});
391
+ $get-size: map-get($get-scale, $fontsize);
392
+ $rootsize: nth($sizes, $i);
393
+ $baseline-shift: #{($get-size / 2 * (($lineheight * $rootsize / $get-size) - $cap-height)) / $rootsize + 0.00001};
394
+ $baseline-push: #{$below - (($get-size / 2 * (($lineheight * $rootsize / $get-size) - $cap-height)) / $rootsize + 0.00001)};
395
+ @media screen and (min-width: nth($points, $i) / 16 * 1em ) {
396
+ font-size: #{$get-size / nth($sizes, $i)}rem;
397
+ margin-bottom: #{$baseline-push}rem;
398
+ padding-top: #{$baseline-shift}rem;
399
+ }
400
+ }
401
+
402
+ } @else {
403
+ @warn "#{$fontsize} is not a valid scale variable";
404
+ }
405
+
406
+ } @else {
407
+ @warn "#{$breakpoint} is not valid to use as a breakpoint";
408
+ }
409
+ }
410
+
411
+ // Clearfix.
412
+ @mixin clearfix {
413
+ &:before, &:after{
414
+ display: table;
415
+ content: "";
416
+ }
417
+ &:after{
418
+ clear: both;
419
+ }
420
+ }