creek-jekyll-theme 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE.txt +21 -0
- data/README.md +81 -0
- data/_config.yml +306 -0
- data/_data/README.md +3 -0
- data/_data/navigation/docs.yml +56 -0
- data/_data/navigation/main.yml +12 -0
- data/_data/navigation.yml +68 -0
- data/_data/ui-text.yml +2024 -0
- data/_includes/analytics-providers/custom.html +3 -0
- data/_includes/analytics-providers/google-gtag.html +9 -0
- data/_includes/analytics-providers/google-universal.html +7 -0
- data/_includes/analytics-providers/google.html +14 -0
- data/_includes/analytics.html +14 -0
- data/_includes/archive-single.html +30 -0
- data/_includes/author-profile-custom-links.html +7 -0
- data/_includes/author-profile.html +246 -0
- data/_includes/breadcrumbs.html +40 -0
- data/_includes/browser-upgrade.html +2 -0
- data/_includes/category-list.html +19 -0
- data/_includes/comment.html +22 -0
- data/_includes/comments-providers/custom.html +3 -0
- data/_includes/comments-providers/custom_scripts.html +3 -0
- data/_includes/comments-providers/discourse.html +13 -0
- data/_includes/comments-providers/disqus.html +15 -0
- data/_includes/comments-providers/facebook.html +8 -0
- data/_includes/comments-providers/giscus.html +24 -0
- data/_includes/comments-providers/scripts.html +20 -0
- data/_includes/comments-providers/staticman.html +40 -0
- data/_includes/comments-providers/staticman_v2.html +40 -0
- data/_includes/comments-providers/utterances.html +21 -0
- data/_includes/comments.html +180 -0
- data/_includes/documents-collection.html +15 -0
- data/_includes/feature_row +41 -0
- data/_includes/figure +9 -0
- data/_includes/footer/custom.html +3 -0
- data/_includes/footer.html +21 -0
- data/_includes/gallery +35 -0
- data/_includes/group-by-array +47 -0
- data/_includes/head/custom.html +15 -0
- data/_includes/head.html +25 -0
- data/_includes/masthead.html +35 -0
- data/_includes/nav_list +26 -0
- data/_includes/page__date.html +6 -0
- data/_includes/page__hero.html +55 -0
- data/_includes/page__hero_video.html +2 -0
- data/_includes/page__meta.html +31 -0
- data/_includes/page__taxonomy.html +7 -0
- data/_includes/paginator.html +69 -0
- data/_includes/post_pagination.html +14 -0
- data/_includes/posts-category.html +5 -0
- data/_includes/posts-tag.html +5 -0
- data/_includes/scripts.html +28 -0
- data/_includes/search/algolia-search-scripts.html +62 -0
- data/_includes/search/google-search-scripts.html +30 -0
- data/_includes/search/lunr-search-scripts.html +10 -0
- data/_includes/search/search_form.html +26 -0
- data/_includes/seo.html +158 -0
- data/_includes/sidebar.html +19 -0
- data/_includes/skip-links.html +7 -0
- data/_includes/social-share.html +11 -0
- data/_includes/tag-list.html +19 -0
- data/_includes/toc +7 -0
- data/_includes/toc.html +182 -0
- data/_includes/video +24 -0
- data/_layouts/archive-taxonomy.html +29 -0
- data/_layouts/archive.html +26 -0
- data/_layouts/categories.html +43 -0
- data/_layouts/category.html +10 -0
- data/_layouts/collection.html +10 -0
- data/_layouts/compress.html +10 -0
- data/_layouts/default.html +41 -0
- data/_layouts/home.html +22 -0
- data/_layouts/posts.html +30 -0
- data/_layouts/search.html +42 -0
- data/_layouts/single.html +95 -0
- data/_layouts/splash.html +22 -0
- data/_layouts/tag.html +10 -0
- data/_layouts/tags.html +43 -0
- data/_pages/404.html +26 -0
- data/_sass/minimal-mistakes/_animations.scss +21 -0
- data/_sass/minimal-mistakes/_archive.scss +463 -0
- data/_sass/minimal-mistakes/_base.scss +339 -0
- data/_sass/minimal-mistakes/_buttons.scss +97 -0
- data/_sass/minimal-mistakes/_footer.scss +85 -0
- data/_sass/minimal-mistakes/_forms.scss +359 -0
- data/_sass/minimal-mistakes/_masthead.scss +93 -0
- data/_sass/minimal-mistakes/_mixins.scss +92 -0
- data/_sass/minimal-mistakes/_navigation.scss +573 -0
- data/_sass/minimal-mistakes/_notices.scss +109 -0
- data/_sass/minimal-mistakes/_page.scss +578 -0
- data/_sass/minimal-mistakes/_print.scss +252 -0
- data/_sass/minimal-mistakes/_reset.scss +187 -0
- data/_sass/minimal-mistakes/_search.scss +132 -0
- data/_sass/minimal-mistakes/_sidebar.scss +353 -0
- data/_sass/minimal-mistakes/_syntax.scss +324 -0
- data/_sass/minimal-mistakes/_tables.scss +39 -0
- data/_sass/minimal-mistakes/_utilities.scss +593 -0
- data/_sass/minimal-mistakes/_variables.scss +173 -0
- data/_sass/minimal-mistakes/skins/_air.scss +23 -0
- data/_sass/minimal-mistakes/skins/_aqua.scss +34 -0
- data/_sass/minimal-mistakes/skins/_contrast.scss +52 -0
- data/_sass/minimal-mistakes/skins/_dark.scss +30 -0
- data/_sass/minimal-mistakes/skins/_default.scss +5 -0
- data/_sass/minimal-mistakes/skins/_dirt.scss +33 -0
- data/_sass/minimal-mistakes/skins/_mint.scss +24 -0
- data/_sass/minimal-mistakes/skins/_neon.scss +63 -0
- data/_sass/minimal-mistakes/skins/_plum.scss +70 -0
- data/_sass/minimal-mistakes/skins/_sunrise.scss +49 -0
- data/_sass/minimal-mistakes/vendor/breakpoint/_breakpoint.scss +114 -0
- data/_sass/minimal-mistakes/vendor/breakpoint/_context.scss +95 -0
- data/_sass/minimal-mistakes/vendor/breakpoint/_helpers.scss +151 -0
- data/_sass/minimal-mistakes/vendor/breakpoint/_legacy-settings.scss +50 -0
- data/_sass/minimal-mistakes/vendor/breakpoint/_no-query.scss +15 -0
- data/_sass/minimal-mistakes/vendor/breakpoint/_parsers.scss +215 -0
- data/_sass/minimal-mistakes/vendor/breakpoint/_respond-to.scss +82 -0
- data/_sass/minimal-mistakes/vendor/breakpoint/_settings.scss +71 -0
- data/_sass/minimal-mistakes/vendor/breakpoint/parsers/_double.scss +33 -0
- data/_sass/minimal-mistakes/vendor/breakpoint/parsers/_query.scss +82 -0
- data/_sass/minimal-mistakes/vendor/breakpoint/parsers/_resolution.scss +31 -0
- data/_sass/minimal-mistakes/vendor/breakpoint/parsers/_single.scss +26 -0
- data/_sass/minimal-mistakes/vendor/breakpoint/parsers/_triple.scss +36 -0
- data/_sass/minimal-mistakes/vendor/breakpoint/parsers/double/_default-pair.scss +21 -0
- data/_sass/minimal-mistakes/vendor/breakpoint/parsers/double/_default.scss +22 -0
- data/_sass/minimal-mistakes/vendor/breakpoint/parsers/double/_double-string.scss +22 -0
- data/_sass/minimal-mistakes/vendor/breakpoint/parsers/resolution/_resolution.scss +60 -0
- data/_sass/minimal-mistakes/vendor/breakpoint/parsers/single/_default.scss +13 -0
- data/_sass/minimal-mistakes/vendor/breakpoint/parsers/triple/_default.scss +18 -0
- data/_sass/minimal-mistakes/vendor/magnific-popup/_magnific-popup.scss +649 -0
- data/_sass/minimal-mistakes/vendor/magnific-popup/_settings.scss +46 -0
- data/_sass/minimal-mistakes/vendor/susy/_su.scss +4 -0
- data/_sass/minimal-mistakes/vendor/susy/_susy-prefix.scss +13 -0
- data/_sass/minimal-mistakes/vendor/susy/_susy.scss +5 -0
- data/_sass/minimal-mistakes/vendor/susy/plugins/_svg-grid.scss +5 -0
- data/_sass/minimal-mistakes/vendor/susy/plugins/svg-grid/_prefix.scss +7 -0
- data/_sass/minimal-mistakes/vendor/susy/plugins/svg-grid/_svg-api.scss +114 -0
- data/_sass/minimal-mistakes/vendor/susy/plugins/svg-grid/_svg-grid-math.scss +67 -0
- data/_sass/minimal-mistakes/vendor/susy/plugins/svg-grid/_svg-settings.scss +14 -0
- data/_sass/minimal-mistakes/vendor/susy/plugins/svg-grid/_svg-unprefix.scss +18 -0
- data/_sass/minimal-mistakes/vendor/susy/plugins/svg-grid/_svg-utilities.scss +133 -0
- data/_sass/minimal-mistakes/vendor/susy/susy/_api.scss +318 -0
- data/_sass/minimal-mistakes/vendor/susy/susy/_normalize.scss +261 -0
- data/_sass/minimal-mistakes/vendor/susy/susy/_parse.scss +163 -0
- data/_sass/minimal-mistakes/vendor/susy/susy/_settings.scss +329 -0
- data/_sass/minimal-mistakes/vendor/susy/susy/_su-math.scss +441 -0
- data/_sass/minimal-mistakes/vendor/susy/susy/_su-validate.scss +213 -0
- data/_sass/minimal-mistakes/vendor/susy/susy/_syntax-helpers.scss +191 -0
- data/_sass/minimal-mistakes/vendor/susy/susy/_unprefix.scss +56 -0
- data/_sass/minimal-mistakes/vendor/susy/susy/_utilities.scss +167 -0
- data/_sass/minimal-mistakes.scss +40 -0
- data/assets/css/main.scss +9 -0
- data/assets/images/android-chrome-192x192.png +0 -0
- data/assets/images/android-chrome-512x512.png +0 -0
- data/assets/images/apple-touch-icon.png +0 -0
- data/assets/images/browserconfig.xml +9 -0
- data/assets/images/creek-logo.png +0 -0
- data/assets/images/favicon-16x16.png +0 -0
- data/assets/images/favicon-32x32.png +0 -0
- data/assets/images/favicon.ico +0 -0
- data/assets/images/mstile-150x150.png +0 -0
- data/assets/images/safari-pinned-tab.svg +48 -0
- data/assets/images/site-under-construction.png +0 -0
- data/assets/images/site.webmanifest +19 -0
- data/assets/js/_main.js +136 -0
- data/assets/js/lunr/lunr-en.js +73 -0
- data/assets/js/lunr/lunr-gr.js +526 -0
- data/assets/js/lunr/lunr-store.js +84 -0
- data/assets/js/lunr/lunr.js +3475 -0
- data/assets/js/lunr/lunr.min.js +6 -0
- data/assets/js/main.min.js +6 -0
- data/assets/js/plugins/gumshoe.js +484 -0
- data/assets/js/plugins/jquery.ba-throttle-debounce.js +252 -0
- data/assets/js/plugins/jquery.fitvids.js +82 -0
- data/assets/js/plugins/jquery.greedy-navigation.js +127 -0
- data/assets/js/plugins/jquery.magnific-popup.js +1860 -0
- data/assets/js/plugins/smooth-scroll.js +650 -0
- data/assets/js/vendor/jquery/jquery-3.6.0.js +10881 -0
- metadata +233 -0
@@ -0,0 +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
|
+
}
|
@@ -0,0 +1,163 @@
|
|
1
|
+
/// Shorthand Syntax Parser
|
2
|
+
/// =======================
|
3
|
+
/// The syntax parser converts [shorthand syntax][short]
|
4
|
+
/// into a map of settings that can be compared/merged with
|
5
|
+
/// other config maps and global setting.
|
6
|
+
///
|
7
|
+
/// [short]: b-api.html
|
8
|
+
///
|
9
|
+
/// @group x-parser
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
// Parse
|
14
|
+
// -----
|
15
|
+
/// The `parse` function provides all the syntax-sugar in Susy,
|
16
|
+
/// converting user shorthand
|
17
|
+
/// into a usable map of keys and values
|
18
|
+
/// that can be normalized and passed to Su.
|
19
|
+
///
|
20
|
+
/// @group x-parser
|
21
|
+
/// @see $susy
|
22
|
+
///
|
23
|
+
/// @param {list} $shorthand -
|
24
|
+
/// Shorthand expression to define the width of the span,
|
25
|
+
/// optionally containing:
|
26
|
+
/// - a count, length, or column-list span;
|
27
|
+
/// - `at $n`, `first`, or `last` location on asymmetrical grids;
|
28
|
+
/// - `narrow`, `wide`, or `wider` for optionally spreading
|
29
|
+
/// across adjacent gutters;
|
30
|
+
/// - `of $n <spread>` for available grid columns
|
31
|
+
/// and spread of the container
|
32
|
+
/// (span counts like `of 6` are only valid
|
33
|
+
/// in the context of symmetrical grids);
|
34
|
+
/// - and `set-gutters $n` to override global gutter settings
|
35
|
+
/// @param {bool} $context-only [false] -
|
36
|
+
/// Allow the parser to ignore span and span-spread values,
|
37
|
+
/// only parsing context and container-spread.
|
38
|
+
/// This makes it possible to accept spanless values,
|
39
|
+
/// like the `gutters()` syntax.
|
40
|
+
/// When parsing context-only,
|
41
|
+
/// the `of` indicator is optional.
|
42
|
+
///
|
43
|
+
/// @return {map} -
|
44
|
+
/// Map of span and grid settings
|
45
|
+
/// parsed from shorthand input –
|
46
|
+
/// including all the properties available globally –
|
47
|
+
/// `columns`, `gutters`, `spread`, `container-spread` –
|
48
|
+
/// along with the span-specific properties
|
49
|
+
/// `span`, and `location`.
|
50
|
+
///
|
51
|
+
/// @throw
|
52
|
+
/// when a shorthand value is not recognized
|
53
|
+
@function susy-parse(
|
54
|
+
$shorthand,
|
55
|
+
$context-only: false
|
56
|
+
) {
|
57
|
+
$parse-error: 'Unknown shorthand property:';
|
58
|
+
$options: (
|
59
|
+
'first': 'location',
|
60
|
+
'last': 'location',
|
61
|
+
'alpha': 'location',
|
62
|
+
'omega': 'location',
|
63
|
+
'narrow': 'spread',
|
64
|
+
'wide': 'spread',
|
65
|
+
'wider': 'spread',
|
66
|
+
);
|
67
|
+
|
68
|
+
$return: ();
|
69
|
+
$span: null;
|
70
|
+
$columns: null;
|
71
|
+
|
72
|
+
$of: null;
|
73
|
+
$next: false;
|
74
|
+
|
75
|
+
// Allow context-only shorthand, without span
|
76
|
+
@if ($context-only) and (not index($shorthand, 'of')) {
|
77
|
+
@if su-valid-columns($shorthand, 'fail-silent') {
|
78
|
+
$shorthand: 'of' $shorthand;
|
79
|
+
} @else {
|
80
|
+
$shorthand: join('of', $shorthand);
|
81
|
+
}
|
82
|
+
}
|
83
|
+
|
84
|
+
// loop through the shorthand list
|
85
|
+
@for $i from 1 through length($shorthand) {
|
86
|
+
$item: nth($shorthand, $i);
|
87
|
+
$type: type-of($item);
|
88
|
+
$error: false;
|
89
|
+
$details: '[#{$type}] `#{$item}`';
|
90
|
+
|
91
|
+
// if we know what's supposed to be coming next…
|
92
|
+
@if $next {
|
93
|
+
|
94
|
+
// Add to the return map
|
95
|
+
$return: map-merge($return, ($next: $item));
|
96
|
+
|
97
|
+
// Reset next to `false`
|
98
|
+
$next: false;
|
99
|
+
|
100
|
+
} @else { // If we don't know what's supposed to be coming…
|
101
|
+
|
102
|
+
// Keywords…
|
103
|
+
@if ($type == 'string') {
|
104
|
+
// Check the map for keywords…
|
105
|
+
@if map-has-key($options, $item) {
|
106
|
+
$setting: map-get($options, $item);
|
107
|
+
|
108
|
+
// Spread could be on the span or the container…
|
109
|
+
@if ($setting == 'spread') and ($of) {
|
110
|
+
$return: map-merge($return, ('container-spread': $item));
|
111
|
+
} @else {
|
112
|
+
$return: map-merge($return, ($setting: $item));
|
113
|
+
}
|
114
|
+
|
115
|
+
} @else if ($item == 'all') {
|
116
|
+
// `All` is a span shortcut
|
117
|
+
$span: 'all';
|
118
|
+
} @else if ($item == 'at') {
|
119
|
+
// Some keywords setup what's next…
|
120
|
+
$next: 'location';
|
121
|
+
} @else if ($item == 'set-gutters') {
|
122
|
+
$next: 'gutters';
|
123
|
+
} @else if ($item == 'of') {
|
124
|
+
$of: true;
|
125
|
+
} @else {
|
126
|
+
$error: true;
|
127
|
+
}
|
128
|
+
|
129
|
+
} @else if ($type == 'number') or ($type == 'list') { // Numbers & lists…
|
130
|
+
|
131
|
+
@if not ($span or $of) {
|
132
|
+
// We don't have a span, and we're not expecting context…
|
133
|
+
$span: $item;
|
134
|
+
} @else if ($of) and (not $columns) {
|
135
|
+
// We are expecting context…
|
136
|
+
$columns: $item;
|
137
|
+
} @else {
|
138
|
+
$error: true;
|
139
|
+
}
|
140
|
+
|
141
|
+
} @else {
|
142
|
+
$error: true;
|
143
|
+
}
|
144
|
+
}
|
145
|
+
|
146
|
+
@if $error {
|
147
|
+
@return _susy-error('#{$parse-error} #{$details}', 'susy-parse');
|
148
|
+
}
|
149
|
+
}
|
150
|
+
|
151
|
+
// If we have span, merge it in
|
152
|
+
@if $span {
|
153
|
+
$return: map-merge($return, ('span': $span));
|
154
|
+
}
|
155
|
+
|
156
|
+
// If we have columns, merge them in
|
157
|
+
@if $columns {
|
158
|
+
$return: map-merge($return, ('columns': $columns));
|
159
|
+
}
|
160
|
+
|
161
|
+
// Return the map of settings…
|
162
|
+
@return $return;
|
163
|
+
}
|