jekyll-theme-basically-basic 1.3.1 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +18 -0
- data/README.md +150 -42
- data/_includes/author +30 -30
- data/_includes/contact-list.html +27 -27
- data/_includes/cv/awards.html +23 -23
- data/_includes/cv/basics.html +68 -68
- data/_includes/cv/education.html +36 -36
- data/_includes/cv/interests.html +19 -19
- data/_includes/cv/intro.html +18 -18
- data/_includes/cv/languages.html +19 -19
- data/_includes/cv/publications.html +29 -29
- data/_includes/cv/references.html +23 -23
- data/_includes/cv/volunteer.html +46 -46
- data/_includes/cv/work.html +46 -46
- data/_includes/disqus_comments.html +16 -16
- data/_includes/documents-collection.html +19 -0
- data/_includes/entry.html +37 -29
- data/_includes/footer.html +11 -9
- data/_includes/google-analytics.html +8 -8
- data/_includes/head.html +35 -35
- data/_includes/icon-bitbucket.html +4 -4
- data/_includes/icon-codepen.html +4 -4
- data/_includes/icon-dribbble.html +4 -4
- data/_includes/icon-facebook.html +4 -4
- data/_includes/icon-flickr.html +4 -4
- data/_includes/icon-github.html +4 -4
- data/_includes/icon-gitlab.html +4 -4
- data/_includes/icon-googleplus.html +4 -4
- data/_includes/icon-instagram.html +4 -4
- data/_includes/icon-lastfm.html +4 -4
- data/_includes/icon-linkedin.html +4 -4
- data/_includes/icon-pinterest.html +4 -4
- data/_includes/icon-soundcloud.html +4 -4
- data/_includes/icon-stackoverflow.html +4 -4
- data/_includes/icon-tumblr.html +4 -4
- data/_includes/icon-twitter.html +4 -4
- data/_includes/icon-xing.html +4 -4
- data/_includes/icon-youtube.html +4 -4
- data/_includes/masthead.html +27 -27
- data/_includes/navigation.html +25 -25
- data/_includes/page-intro.html +42 -42
- data/_includes/page-tags.html +14 -0
- data/_includes/posts-all.html +2 -2
- data/_includes/posts-category.html +3 -0
- data/_includes/posts-paginated.html +15 -15
- data/_includes/posts-tag.html +3 -0
- data/_includes/read-time.html +13 -13
- data/_includes/search-form.html +14 -13
- data/_includes/search/algolia-search-scripts.html +52 -52
- data/_includes/search/lunr-search-scripts.html +1 -1
- data/_includes/skip-links.html +8 -8
- data/_layouts/about.html +0 -2
- data/_layouts/categories.html +48 -0
- data/_layouts/category.html +9 -0
- data/_layouts/collection.html +9 -0
- data/_layouts/cv.html +28 -28
- data/_layouts/default.html +2 -1
- data/_layouts/home.html +28 -30
- data/_layouts/page.html +15 -17
- data/_layouts/post.html +18 -20
- data/_layouts/posts.html +29 -0
- data/_layouts/tag.html +9 -0
- data/_layouts/tags.html +48 -0
- data/_sass/basically-basic.scss +1 -1
- data/_sass/basically-basic/_base.scss +116 -118
- data/_sass/basically-basic/_contact-lists.scss +11 -11
- data/_sass/basically-basic/_entries.scss +230 -152
- data/_sass/basically-basic/_footer.scss +37 -13
- data/_sass/basically-basic/_functions.scss +2 -2
- data/_sass/basically-basic/_global.scss +116 -42
- data/_sass/basically-basic/_icons.scss +43 -43
- data/_sass/basically-basic/_intro.scss +3 -1
- data/_sass/basically-basic/_layout.scss +188 -188
- data/_sass/basically-basic/_mixins.scss +5 -5
- data/_sass/basically-basic/_navicons.scss +148 -148
- data/_sass/basically-basic/_navigation.scss +66 -66
- data/_sass/basically-basic/_print.scss +252 -252
- data/_sass/basically-basic/_reset.scss +522 -522
- data/_sass/basically-basic/_responsive-embed.scss +70 -70
- data/_sass/basically-basic/_search.scss +101 -101
- data/_sass/basically-basic/_sidebar.scss +166 -166
- data/_sass/basically-basic/_tables.scss +34 -34
- data/_sass/basically-basic/_utilities.scss +6 -6
- data/_sass/basically-basic/_variables.scss +3 -0
- data/_sass/basically-basic/functions/_color.scss +21 -21
- data/_sass/basically-basic/functions/_fluid-type.scss +33 -33
- data/_sass/basically-basic/mixins/_clearfix.scss +11 -11
- data/_sass/basically-basic/mixins/_float.scss +15 -15
- data/_sass/basically-basic/mixins/_image.scss +38 -38
- data/_sass/basically-basic/mixins/_lists.scss +9 -9
- data/_sass/basically-basic/mixins/_text-truncate.scss +10 -10
- data/_sass/basically-basic/themes/_default.scss +5 -5
- data/_sass/basically-basic/themes/_night.scss +12 -12
- data/_sass/basically-basic/themes/_plum.scss +12 -12
- data/_sass/basically-basic/themes/_sea.scss +12 -12
- data/_sass/basically-basic/utilities/_accessibility.scss +43 -43
- data/_sass/basically-basic/utilities/_align.scss +62 -62
- data/_sass/basically-basic/utilities/_clearfix.scss +7 -7
- data/_sass/basically-basic/utilities/_float.scss +7 -7
- data/_sass/basically-basic/utilities/_text.scss +28 -28
- data/_sass/basically-basic/utilities/_visibility.scss +32 -32
- data/_sass/basically-basic/vendor/breakpoint/_breakpoint.scss +114 -114
- data/_sass/basically-basic/vendor/breakpoint/_context.scss +94 -94
- data/_sass/basically-basic/vendor/breakpoint/_helpers.scss +151 -151
- data/_sass/basically-basic/vendor/breakpoint/_legacy-settings.scss +49 -49
- data/_sass/basically-basic/vendor/breakpoint/_no-query.scss +15 -15
- data/_sass/basically-basic/vendor/breakpoint/_parsers.scss +215 -215
- data/_sass/basically-basic/vendor/breakpoint/_respond-to.scss +82 -82
- data/_sass/basically-basic/vendor/breakpoint/_settings.scss +70 -70
- data/_sass/basically-basic/vendor/breakpoint/parsers/_double.scss +33 -33
- data/_sass/basically-basic/vendor/breakpoint/parsers/_query.scss +82 -82
- data/_sass/basically-basic/vendor/breakpoint/parsers/_resolution.scss +31 -31
- data/_sass/basically-basic/vendor/breakpoint/parsers/_single.scss +26 -26
- data/_sass/basically-basic/vendor/breakpoint/parsers/_triple.scss +36 -36
- data/_sass/basically-basic/vendor/breakpoint/parsers/double/_default-pair.scss +21 -21
- data/_sass/basically-basic/vendor/breakpoint/parsers/double/_default.scss +22 -22
- data/_sass/basically-basic/vendor/breakpoint/parsers/double/_double-string.scss +21 -21
- data/_sass/basically-basic/vendor/breakpoint/parsers/resolution/_resolution.scss +60 -60
- data/_sass/basically-basic/vendor/breakpoint/parsers/single/_default.scss +13 -13
- data/_sass/basically-basic/vendor/breakpoint/parsers/triple/_default.scss +18 -18
- data/_sass/basically-basic/vendor/susy/_su.scss +4 -4
- data/_sass/basically-basic/vendor/susy/_susy-prefix.scss +13 -13
- data/_sass/basically-basic/vendor/susy/_susy.scss +5 -5
- data/_sass/basically-basic/vendor/susy/plugins/_svg-grid.scss +5 -5
- data/_sass/basically-basic/vendor/susy/plugins/svg-grid/_prefix.scss +7 -7
- data/_sass/basically-basic/vendor/susy/plugins/svg-grid/_svg-api.scss +114 -114
- data/_sass/basically-basic/vendor/susy/plugins/svg-grid/_svg-grid-math.scss +67 -67
- data/_sass/basically-basic/vendor/susy/plugins/svg-grid/_svg-settings.scss +14 -14
- data/_sass/basically-basic/vendor/susy/plugins/svg-grid/_svg-unprefix.scss +18 -18
- data/_sass/basically-basic/vendor/susy/plugins/svg-grid/_svg-utilities.scss +133 -133
- data/_sass/basically-basic/vendor/susy/susy/_api.scss +318 -318
- data/_sass/basically-basic/vendor/susy/susy/_normalize.scss +261 -261
- data/_sass/basically-basic/vendor/susy/susy/_parse.scss +163 -163
- data/_sass/basically-basic/vendor/susy/susy/_settings.scss +329 -329
- data/_sass/basically-basic/vendor/susy/susy/_su-math.scss +441 -441
- data/_sass/basically-basic/vendor/susy/susy/_su-validate.scss +213 -213
- data/_sass/basically-basic/vendor/susy/susy/_syntax-helpers.scss +191 -191
- data/_sass/basically-basic/vendor/susy/susy/_unprefix.scss +56 -56
- data/_sass/basically-basic/vendor/susy/susy/_utilities.scss +167 -167
- data/assets/javascripts/lunr/lunr.da.min.js +17 -17
- data/assets/javascripts/lunr/lunr.de.min.js +17 -17
- data/assets/javascripts/lunr/lunr.du.min.js +17 -17
- data/assets/javascripts/lunr/lunr.es.min.js +17 -17
- data/assets/javascripts/lunr/lunr.fi.min.js +17 -17
- data/assets/javascripts/lunr/lunr.fr.min.js +17 -17
- data/assets/javascripts/lunr/lunr.hu.min.js +17 -17
- data/assets/javascripts/lunr/lunr.it.min.js +17 -17
- data/assets/javascripts/lunr/lunr.jp.min.js +1 -1
- data/assets/javascripts/lunr/lunr.min.js +6 -6
- data/assets/javascripts/lunr/lunr.no.min.js +17 -17
- data/assets/javascripts/lunr/lunr.pt.min.js +17 -17
- data/assets/javascripts/lunr/lunr.ro.min.js +17 -17
- data/assets/javascripts/lunr/lunr.ru.min.js +17 -17
- data/assets/javascripts/lunr/lunr.sv.min.js +17 -17
- data/assets/javascripts/lunr/lunr.tr.min.js +17 -17
- data/assets/javascripts/main.js +12 -12
- data/assets/javascripts/search-data.json +43 -27
- data/assets/stylesheets/main.scss +9 -9
- metadata +21 -5
@@ -1,261 +1,261 @@
|
|
1
|
-
/// Syntax Normalization
|
2
|
-
/// ====================
|
3
|
-
/// Susy is divided into two layers:
|
4
|
-
/// "Su" provides the core math functions with a stripped-down syntax,
|
5
|
-
/// while "Susy" adds global settings, shorthand syntax,
|
6
|
-
/// and other helpers.
|
7
|
-
/// Each setting (e.g. span, location, columns, spread, etc.)
|
8
|
-
/// has a single canonical syntax in Su.
|
9
|
-
///
|
10
|
-
/// This normalization module helps translate between those layers,
|
11
|
-
/// transforming parsed Susy input into
|
12
|
-
/// values that Su will understand.
|
13
|
-
///
|
14
|
-
/// @group x-normal
|
15
|
-
///
|
16
|
-
/// @see susy-normalize
|
17
|
-
/// @see susy-normalize-span
|
18
|
-
/// @see susy-normalize-columns
|
19
|
-
/// @see susy-normalize-spread
|
20
|
-
/// @see susy-normalize-location
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
// Susy Normalize
|
25
|
-
// --------------
|
26
|
-
/// Normalize the values in a configuration map.
|
27
|
-
/// In addition to the global `$susy` properties,
|
28
|
-
/// this map can include local span-related imformation,
|
29
|
-
/// like `span` and `location`.
|
30
|
-
///
|
31
|
-
/// Normalization does not check that values are valid,
|
32
|
-
/// which will happen in the Su math layer.
|
33
|
-
/// These functions merely look for known Susy syntax –
|
34
|
-
/// returning a map with those shorthand values
|
35
|
-
/// converted into low-level data for Su.
|
36
|
-
/// For example `span: all` and `location: first`
|
37
|
-
/// will be converted into specific numbers.
|
38
|
-
///
|
39
|
-
/// @group x-normal
|
40
|
-
/// @see $susy
|
41
|
-
/// @see susy-parse
|
42
|
-
///
|
43
|
-
/// @param {map} $config -
|
44
|
-
/// Map of Susy configuration settings to normalize.
|
45
|
-
/// See `$susy` and `susy-parse()` documentation for details.
|
46
|
-
/// @param {map | null} $context [null] -
|
47
|
-
/// Map of Susy configuration settings to use as global reference,
|
48
|
-
/// or `null` to use global settings.
|
49
|
-
///
|
50
|
-
/// @return {map} -
|
51
|
-
/// Map of Susy configuration settings,
|
52
|
-
/// with all values normalized for Su math functions.
|
53
|
-
@function susy-normalize(
|
54
|
-
$config,
|
55
|
-
$context: null
|
56
|
-
) {
|
57
|
-
// Spread
|
58
|
-
@each $setting in ('spread', 'container-spread') {
|
59
|
-
$value: map-get($config, $setting);
|
60
|
-
|
61
|
-
@if $value {
|
62
|
-
$value: susy-normalize-spread($value);
|
63
|
-
$config: map-merge($config, ($setting: $value));
|
64
|
-
}
|
65
|
-
}
|
66
|
-
|
67
|
-
// Columns
|
68
|
-
$columns: map-get($config, 'columns');
|
69
|
-
|
70
|
-
@if $columns {
|
71
|
-
$columns: susy-normalize-columns($columns, $context);
|
72
|
-
$config: map-merge($config, ('columns': $columns));
|
73
|
-
}
|
74
|
-
|
75
|
-
@if not $columns {
|
76
|
-
$map: type-of($context) == 'map';
|
77
|
-
$columns: if($map, map-get($context, 'columns'), null);
|
78
|
-
$columns: $columns or susy-get('columns');
|
79
|
-
}
|
80
|
-
|
81
|
-
// Span
|
82
|
-
$span: map-get($config, 'span');
|
83
|
-
|
84
|
-
@if $span {
|
85
|
-
$span: susy-normalize-span($span, $columns);
|
86
|
-
$config: map-merge($config, ('span': $span));
|
87
|
-
}
|
88
|
-
|
89
|
-
// Location
|
90
|
-
$location: map-get($config, 'location');
|
91
|
-
|
92
|
-
@if $location {
|
93
|
-
$location: susy-normalize-location($span, $location, $columns);
|
94
|
-
$config: map-merge($config, ('location': $location));
|
95
|
-
}
|
96
|
-
|
97
|
-
@return $config;
|
98
|
-
}
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
// Normalize Span
|
103
|
-
// --------------
|
104
|
-
/// Normalize `span` shorthand for Su.
|
105
|
-
/// Su span syntax allows an explicit length (e.g. `3em`),
|
106
|
-
/// unitless column-span number (e.g. `3` columns),
|
107
|
-
/// or an explicit list of columns (e.g. `(3 5 8)`).
|
108
|
-
///
|
109
|
-
/// Susy span syntax also allows the `all` keyword,
|
110
|
-
/// which will be converted to a slice of the context
|
111
|
-
/// in normalization.
|
112
|
-
///
|
113
|
-
/// @group x-normal
|
114
|
-
///
|
115
|
-
/// @param {number | list | 'all'} $span -
|
116
|
-
/// Span value to normalize.
|
117
|
-
/// @param {list} $columns -
|
118
|
-
/// Normalized list of columns in the grid
|
119
|
-
///
|
120
|
-
/// @return {number | list} -
|
121
|
-
/// Number or list value for `$span`
|
122
|
-
@function susy-normalize-span(
|
123
|
-
$span,
|
124
|
-
$columns: susy-get('columns')
|
125
|
-
) {
|
126
|
-
@if ($span == 'all') {
|
127
|
-
@return length($columns);
|
128
|
-
}
|
129
|
-
|
130
|
-
@return $span;
|
131
|
-
}
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
// Normalize Columns
|
136
|
-
// -----------------
|
137
|
-
/// Normalize `column` shorthand for Su.
|
138
|
-
/// Su column syntax only allows column lists (e.g. `120px 1 1 1 120px`).
|
139
|
-
///
|
140
|
-
/// Susy span syntax also allows a unitless `slice` number (e.g `of 5`),
|
141
|
-
/// which will be converted to a slice of the context
|
142
|
-
/// in normalization.
|
143
|
-
///
|
144
|
-
/// @group x-normal
|
145
|
-
///
|
146
|
-
/// @param {list | integer} $columns -
|
147
|
-
/// List of available columns,
|
148
|
-
/// or unitless integer representing a slice of
|
149
|
-
/// the available context.
|
150
|
-
/// @param {map | null} $context [null] -
|
151
|
-
/// Map of Susy configuration settings to use as global reference,
|
152
|
-
/// or `null` to access global settings.
|
153
|
-
///
|
154
|
-
/// @return {list} -
|
155
|
-
/// Columns list value, normalized for Su input.
|
156
|
-
///
|
157
|
-
/// @throws
|
158
|
-
/// when attempting to access a slice of asymmetrical context
|
159
|
-
@function susy-normalize-columns(
|
160
|
-
$columns,
|
161
|
-
$context: null
|
162
|
-
) {
|
163
|
-
$context: $context or susy-settings();
|
164
|
-
|
165
|
-
@if type-of($columns) == 'list' {
|
166
|
-
@return _susy-flatten($columns);
|
167
|
-
}
|
168
|
-
|
169
|
-
@if (type-of($columns) == 'number') and (unitless($columns)) {
|
170
|
-
$span: $columns;
|
171
|
-
$context: map-get($context, 'columns');
|
172
|
-
$symmetrical: susy-repeat(length($context), nth($context, 1));
|
173
|
-
|
174
|
-
@if ($context == $symmetrical) {
|
175
|
-
@return susy-repeat($span, nth($context, 1));
|
176
|
-
} @else {
|
177
|
-
$actual: 'of `#{$span}`';
|
178
|
-
$columns: 'grid-columns `#{$context}`';
|
179
|
-
@return _susy-error(
|
180
|
-
'context-slice #{$actual} can not be determined based on #{$columns}.',
|
181
|
-
'susy-normalize-columns');
|
182
|
-
}
|
183
|
-
}
|
184
|
-
|
185
|
-
@return $columns;
|
186
|
-
}
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
// Normalize Spread
|
191
|
-
// ----------------
|
192
|
-
/// Normalize `spread` shorthand for Su.
|
193
|
-
/// Su spread syntax only allows the numbers `-1`, `0`, or `1` –
|
194
|
-
/// representing the number of gutters covered
|
195
|
-
/// in relation to columns spanned.
|
196
|
-
///
|
197
|
-
/// Susy spread syntax also allows keywords for each value –
|
198
|
-
/// `narrow` for `-1`, `wide` for `0`, or `wider` for `1` –
|
199
|
-
/// which will be converted to their respective integers
|
200
|
-
/// in normalization.
|
201
|
-
///
|
202
|
-
/// @group x-normal
|
203
|
-
///
|
204
|
-
/// @param {0 | 1 | -1 | 'narrow' | 'wide' | 'wider'} $spread -
|
205
|
-
/// Spread across adjacent gutters, relative to a column-count —
|
206
|
-
/// either `narrow` (-1), `wide` (0), or `wider` (1)
|
207
|
-
///
|
208
|
-
/// @return {number} -
|
209
|
-
/// Numeric value for `$spread`
|
210
|
-
@function susy-normalize-spread(
|
211
|
-
$spread
|
212
|
-
) {
|
213
|
-
$normal-spread: (
|
214
|
-
'narrow': -1,
|
215
|
-
'wide': 0,
|
216
|
-
'wider': 1,
|
217
|
-
);
|
218
|
-
|
219
|
-
@return map-get($normal-spread, $spread) or $spread;
|
220
|
-
}
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
// Normalize Location
|
225
|
-
// ------------------
|
226
|
-
/// Normalize `location` shorthand for Su.
|
227
|
-
/// Su location syntax requires the (1-indexed) number for a column.
|
228
|
-
///
|
229
|
-
/// Susy also allows the `first` and `last` keywords,
|
230
|
-
/// where `first` is always `1`,
|
231
|
-
/// and `last` is calculated based on span and column values.
|
232
|
-
/// Both keywords are normalized into an integer index
|
233
|
-
/// in normalization.
|
234
|
-
///
|
235
|
-
/// @group x-normal
|
236
|
-
///
|
237
|
-
/// @param {number} $span -
|
238
|
-
/// Number of grid-columns to be spanned
|
239
|
-
/// @param {integer | 'first' | 'last'} $location -
|
240
|
-
/// Starting (1-indexed) column position of a span,
|
241
|
-
/// or a named location keyword.
|
242
|
-
/// @param {list} $columns -
|
243
|
-
/// Already-normalized list of columns in the grid.
|
244
|
-
///
|
245
|
-
/// @return {integer} -
|
246
|
-
/// Numeric value for `$location`
|
247
|
-
@function susy-normalize-location(
|
248
|
-
$span,
|
249
|
-
$location,
|
250
|
-
$columns
|
251
|
-
) {
|
252
|
-
$count: length($columns);
|
253
|
-
$normal-locations: (
|
254
|
-
'first': 1,
|
255
|
-
'alpha': 1,
|
256
|
-
'last': $count - $span + 1,
|
257
|
-
'omega': $count - $span + 1,
|
258
|
-
);
|
259
|
-
|
260
|
-
@return map-get($normal-locations, $location) or $location;
|
261
|
-
}
|
1
|
+
/// Syntax Normalization
|
2
|
+
/// ====================
|
3
|
+
/// Susy is divided into two layers:
|
4
|
+
/// "Su" provides the core math functions with a stripped-down syntax,
|
5
|
+
/// while "Susy" adds global settings, shorthand syntax,
|
6
|
+
/// and other helpers.
|
7
|
+
/// Each setting (e.g. span, location, columns, spread, etc.)
|
8
|
+
/// has a single canonical syntax in Su.
|
9
|
+
///
|
10
|
+
/// This normalization module helps translate between those layers,
|
11
|
+
/// transforming parsed Susy input into
|
12
|
+
/// values that Su will understand.
|
13
|
+
///
|
14
|
+
/// @group x-normal
|
15
|
+
///
|
16
|
+
/// @see susy-normalize
|
17
|
+
/// @see susy-normalize-span
|
18
|
+
/// @see susy-normalize-columns
|
19
|
+
/// @see susy-normalize-spread
|
20
|
+
/// @see susy-normalize-location
|
21
|
+
|
22
|
+
|
23
|
+
|
24
|
+
// Susy Normalize
|
25
|
+
// --------------
|
26
|
+
/// Normalize the values in a configuration map.
|
27
|
+
/// In addition to the global `$susy` properties,
|
28
|
+
/// this map can include local span-related imformation,
|
29
|
+
/// like `span` and `location`.
|
30
|
+
///
|
31
|
+
/// Normalization does not check that values are valid,
|
32
|
+
/// which will happen in the Su math layer.
|
33
|
+
/// These functions merely look for known Susy syntax –
|
34
|
+
/// returning a map with those shorthand values
|
35
|
+
/// converted into low-level data for Su.
|
36
|
+
/// For example `span: all` and `location: first`
|
37
|
+
/// will be converted into specific numbers.
|
38
|
+
///
|
39
|
+
/// @group x-normal
|
40
|
+
/// @see $susy
|
41
|
+
/// @see susy-parse
|
42
|
+
///
|
43
|
+
/// @param {map} $config -
|
44
|
+
/// Map of Susy configuration settings to normalize.
|
45
|
+
/// See `$susy` and `susy-parse()` documentation for details.
|
46
|
+
/// @param {map | null} $context [null] -
|
47
|
+
/// Map of Susy configuration settings to use as global reference,
|
48
|
+
/// or `null` to use global settings.
|
49
|
+
///
|
50
|
+
/// @return {map} -
|
51
|
+
/// Map of Susy configuration settings,
|
52
|
+
/// with all values normalized for Su math functions.
|
53
|
+
@function susy-normalize(
|
54
|
+
$config,
|
55
|
+
$context: null
|
56
|
+
) {
|
57
|
+
// Spread
|
58
|
+
@each $setting in ('spread', 'container-spread') {
|
59
|
+
$value: map-get($config, $setting);
|
60
|
+
|
61
|
+
@if $value {
|
62
|
+
$value: susy-normalize-spread($value);
|
63
|
+
$config: map-merge($config, ($setting: $value));
|
64
|
+
}
|
65
|
+
}
|
66
|
+
|
67
|
+
// Columns
|
68
|
+
$columns: map-get($config, 'columns');
|
69
|
+
|
70
|
+
@if $columns {
|
71
|
+
$columns: susy-normalize-columns($columns, $context);
|
72
|
+
$config: map-merge($config, ('columns': $columns));
|
73
|
+
}
|
74
|
+
|
75
|
+
@if not $columns {
|
76
|
+
$map: type-of($context) == 'map';
|
77
|
+
$columns: if($map, map-get($context, 'columns'), null);
|
78
|
+
$columns: $columns or susy-get('columns');
|
79
|
+
}
|
80
|
+
|
81
|
+
// Span
|
82
|
+
$span: map-get($config, 'span');
|
83
|
+
|
84
|
+
@if $span {
|
85
|
+
$span: susy-normalize-span($span, $columns);
|
86
|
+
$config: map-merge($config, ('span': $span));
|
87
|
+
}
|
88
|
+
|
89
|
+
// Location
|
90
|
+
$location: map-get($config, 'location');
|
91
|
+
|
92
|
+
@if $location {
|
93
|
+
$location: susy-normalize-location($span, $location, $columns);
|
94
|
+
$config: map-merge($config, ('location': $location));
|
95
|
+
}
|
96
|
+
|
97
|
+
@return $config;
|
98
|
+
}
|
99
|
+
|
100
|
+
|
101
|
+
|
102
|
+
// Normalize Span
|
103
|
+
// --------------
|
104
|
+
/// Normalize `span` shorthand for Su.
|
105
|
+
/// Su span syntax allows an explicit length (e.g. `3em`),
|
106
|
+
/// unitless column-span number (e.g. `3` columns),
|
107
|
+
/// or an explicit list of columns (e.g. `(3 5 8)`).
|
108
|
+
///
|
109
|
+
/// Susy span syntax also allows the `all` keyword,
|
110
|
+
/// which will be converted to a slice of the context
|
111
|
+
/// in normalization.
|
112
|
+
///
|
113
|
+
/// @group x-normal
|
114
|
+
///
|
115
|
+
/// @param {number | list | 'all'} $span -
|
116
|
+
/// Span value to normalize.
|
117
|
+
/// @param {list} $columns -
|
118
|
+
/// Normalized list of columns in the grid
|
119
|
+
///
|
120
|
+
/// @return {number | list} -
|
121
|
+
/// Number or list value for `$span`
|
122
|
+
@function susy-normalize-span(
|
123
|
+
$span,
|
124
|
+
$columns: susy-get('columns')
|
125
|
+
) {
|
126
|
+
@if ($span == 'all') {
|
127
|
+
@return length($columns);
|
128
|
+
}
|
129
|
+
|
130
|
+
@return $span;
|
131
|
+
}
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
// Normalize Columns
|
136
|
+
// -----------------
|
137
|
+
/// Normalize `column` shorthand for Su.
|
138
|
+
/// Su column syntax only allows column lists (e.g. `120px 1 1 1 120px`).
|
139
|
+
///
|
140
|
+
/// Susy span syntax also allows a unitless `slice` number (e.g `of 5`),
|
141
|
+
/// which will be converted to a slice of the context
|
142
|
+
/// in normalization.
|
143
|
+
///
|
144
|
+
/// @group x-normal
|
145
|
+
///
|
146
|
+
/// @param {list | integer} $columns -
|
147
|
+
/// List of available columns,
|
148
|
+
/// or unitless integer representing a slice of
|
149
|
+
/// the available context.
|
150
|
+
/// @param {map | null} $context [null] -
|
151
|
+
/// Map of Susy configuration settings to use as global reference,
|
152
|
+
/// or `null` to access global settings.
|
153
|
+
///
|
154
|
+
/// @return {list} -
|
155
|
+
/// Columns list value, normalized for Su input.
|
156
|
+
///
|
157
|
+
/// @throws
|
158
|
+
/// when attempting to access a slice of asymmetrical context
|
159
|
+
@function susy-normalize-columns(
|
160
|
+
$columns,
|
161
|
+
$context: null
|
162
|
+
) {
|
163
|
+
$context: $context or susy-settings();
|
164
|
+
|
165
|
+
@if type-of($columns) == 'list' {
|
166
|
+
@return _susy-flatten($columns);
|
167
|
+
}
|
168
|
+
|
169
|
+
@if (type-of($columns) == 'number') and (unitless($columns)) {
|
170
|
+
$span: $columns;
|
171
|
+
$context: map-get($context, 'columns');
|
172
|
+
$symmetrical: susy-repeat(length($context), nth($context, 1));
|
173
|
+
|
174
|
+
@if ($context == $symmetrical) {
|
175
|
+
@return susy-repeat($span, nth($context, 1));
|
176
|
+
} @else {
|
177
|
+
$actual: 'of `#{$span}`';
|
178
|
+
$columns: 'grid-columns `#{$context}`';
|
179
|
+
@return _susy-error(
|
180
|
+
'context-slice #{$actual} can not be determined based on #{$columns}.',
|
181
|
+
'susy-normalize-columns');
|
182
|
+
}
|
183
|
+
}
|
184
|
+
|
185
|
+
@return $columns;
|
186
|
+
}
|
187
|
+
|
188
|
+
|
189
|
+
|
190
|
+
// Normalize Spread
|
191
|
+
// ----------------
|
192
|
+
/// Normalize `spread` shorthand for Su.
|
193
|
+
/// Su spread syntax only allows the numbers `-1`, `0`, or `1` –
|
194
|
+
/// representing the number of gutters covered
|
195
|
+
/// in relation to columns spanned.
|
196
|
+
///
|
197
|
+
/// Susy spread syntax also allows keywords for each value –
|
198
|
+
/// `narrow` for `-1`, `wide` for `0`, or `wider` for `1` –
|
199
|
+
/// which will be converted to their respective integers
|
200
|
+
/// in normalization.
|
201
|
+
///
|
202
|
+
/// @group x-normal
|
203
|
+
///
|
204
|
+
/// @param {0 | 1 | -1 | 'narrow' | 'wide' | 'wider'} $spread -
|
205
|
+
/// Spread across adjacent gutters, relative to a column-count —
|
206
|
+
/// either `narrow` (-1), `wide` (0), or `wider` (1)
|
207
|
+
///
|
208
|
+
/// @return {number} -
|
209
|
+
/// Numeric value for `$spread`
|
210
|
+
@function susy-normalize-spread(
|
211
|
+
$spread
|
212
|
+
) {
|
213
|
+
$normal-spread: (
|
214
|
+
'narrow': -1,
|
215
|
+
'wide': 0,
|
216
|
+
'wider': 1,
|
217
|
+
);
|
218
|
+
|
219
|
+
@return map-get($normal-spread, $spread) or $spread;
|
220
|
+
}
|
221
|
+
|
222
|
+
|
223
|
+
|
224
|
+
// Normalize Location
|
225
|
+
// ------------------
|
226
|
+
/// Normalize `location` shorthand for Su.
|
227
|
+
/// Su location syntax requires the (1-indexed) number for a column.
|
228
|
+
///
|
229
|
+
/// Susy also allows the `first` and `last` keywords,
|
230
|
+
/// where `first` is always `1`,
|
231
|
+
/// and `last` is calculated based on span and column values.
|
232
|
+
/// Both keywords are normalized into an integer index
|
233
|
+
/// in normalization.
|
234
|
+
///
|
235
|
+
/// @group x-normal
|
236
|
+
///
|
237
|
+
/// @param {number} $span -
|
238
|
+
/// Number of grid-columns to be spanned
|
239
|
+
/// @param {integer | 'first' | 'last'} $location -
|
240
|
+
/// Starting (1-indexed) column position of a span,
|
241
|
+
/// or a named location keyword.
|
242
|
+
/// @param {list} $columns -
|
243
|
+
/// Already-normalized list of columns in the grid.
|
244
|
+
///
|
245
|
+
/// @return {integer} -
|
246
|
+
/// Numeric value for `$location`
|
247
|
+
@function susy-normalize-location(
|
248
|
+
$span,
|
249
|
+
$location,
|
250
|
+
$columns
|
251
|
+
) {
|
252
|
+
$count: length($columns);
|
253
|
+
$normal-locations: (
|
254
|
+
'first': 1,
|
255
|
+
'alpha': 1,
|
256
|
+
'last': $count - $span + 1,
|
257
|
+
'omega': $count - $span + 1,
|
258
|
+
);
|
259
|
+
|
260
|
+
@return map-get($normal-locations, $location) or $location;
|
261
|
+
}
|