jekyll-theme-ethereal 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 +437 -0
- data/README.md +538 -0
- data/_includes/banner.html +22 -0
- data/_includes/contact.html +34 -0
- data/_includes/date.html +24 -0
- data/_includes/footer.html +14 -0
- data/_includes/head.html +14 -0
- data/_includes/language.html +14 -0
- data/_includes/logo.html +1 -0
- data/_includes/panel.html +18 -0
- data/_includes/scripts.html +18 -0
- data/_includes/social.html +36 -0
- data/_includes/spotlight.html +12 -0
- data/_includes/thread.html +25 -0
- data/_layouts/default.html +41 -0
- data/_layouts/home.html +8 -0
- data/_layouts/page.html +4 -0
- data/_layouts/post.html +27 -0
- data/_layouts/redirect.html +10 -0
- data/_layouts/sitemap.html +22 -0
- data/_sass/base/_page.scss +117 -0
- data/_sass/base/_reset.scss +76 -0
- data/_sass/base/_typography.scss +271 -0
- data/_sass/components/_actions.scss +63 -0
- data/_sass/components/_button.scss +154 -0
- data/_sass/components/_contact-icons.scss +72 -0
- data/_sass/components/_cookieconsent.scss +403 -0
- data/_sass/components/_form.scss +279 -0
- data/_sass/components/_gallery.scss +218 -0
- data/_sass/components/_grid-icons.scss +166 -0
- data/_sass/components/_icon.scss +33 -0
- data/_sass/components/_icons.scss +28 -0
- data/_sass/components/_image.scss +169 -0
- data/_sass/components/_list.scss +56 -0
- data/_sass/components/_panel-banner.scss +90 -0
- data/_sass/components/_panel-spotlight.scss +81 -0
- data/_sass/components/_panel.scss +300 -0
- data/_sass/components/_table.scss +81 -0
- data/_sass/layout/_footer.scss +49 -0
- data/_sass/layout/_header.scss +37 -0
- data/_sass/layout/_page-wrapper.scss +43 -0
- data/_sass/layout/_wrapper.scss +118 -0
- data/_sass/libs/_breakpoints.scss +223 -0
- data/_sass/libs/_functions.scss +90 -0
- data/_sass/libs/_mixins.scss +78 -0
- data/_sass/libs/_vars.scss +49 -0
- data/_sass/libs/_vendor.scss +376 -0
- data/_sass/main.scss +135 -0
- data/_sass/noscript.scss +26 -0
- data/assets/css/fontawesome-all.min.css +5 -0
- data/assets/css/main.scss +5 -0
- data/assets/css/noscript.scss +5 -0
- data/assets/images/bg.jpg +0 -0
- data/assets/images/drone.jpg +0 -0
- data/assets/images/gallery/fulls/01.jpg +0 -0
- data/assets/images/gallery/fulls/02.jpg +0 -0
- data/assets/images/gallery/fulls/03.jpg +0 -0
- data/assets/images/gallery/fulls/04.jpg +0 -0
- data/assets/images/gallery/fulls/05.jpg +0 -0
- data/assets/images/gallery/fulls/06.jpg +0 -0
- data/assets/images/gallery/fulls/07.jpg +0 -0
- data/assets/images/gallery/fulls/08.jpg +0 -0
- data/assets/images/gallery/fulls/09.jpg +0 -0
- data/assets/images/gallery/thumbs/01.jpg +0 -0
- data/assets/images/gallery/thumbs/02.jpg +0 -0
- data/assets/images/gallery/thumbs/03.jpg +0 -0
- data/assets/images/gallery/thumbs/04.jpg +0 -0
- data/assets/images/gallery/thumbs/05.jpg +0 -0
- data/assets/images/gallery/thumbs/06.jpg +0 -0
- data/assets/images/gallery/thumbs/07.jpg +0 -0
- data/assets/images/gallery/thumbs/08.jpg +0 -0
- data/assets/images/gallery/thumbs/09.jpg +0 -0
- data/assets/images/jupiter_abyss.jpg +0 -0
- data/assets/images/jupiter_storms.jpg +0 -0
- data/assets/images/ngc-1156.jpg +0 -0
- data/assets/images/ngc-3169.jpg +0 -0
- data/assets/images/orion_las.jpg +0 -0
- data/assets/images/overlay.png +0 -0
- data/assets/images/pic01.jpg +0 -0
- data/assets/images/pic02.jpg +0 -0
- data/assets/images/pic03.jpg +0 -0
- data/assets/images/pillars-of-creation.jpg +0 -0
- data/assets/images/saturn_testing.jpg +0 -0
- data/assets/images/sls-core_staging.jpg +0 -0
- data/assets/images/zeta-ophiuchi.jpg +0 -0
- data/assets/js/breakpoints.min.js +2 -0
- data/assets/js/browser.min.js +2 -0
- data/assets/js/cookieconsent.min.js +1 -0
- data/assets/js/jquery.min.js +2 -0
- data/assets/js/main.js +759 -0
- data/assets/webfonts/fa-brands-400.eot +0 -0
- data/assets/webfonts/fa-brands-400.svg +3442 -0
- data/assets/webfonts/fa-brands-400.ttf +0 -0
- data/assets/webfonts/fa-brands-400.woff +0 -0
- data/assets/webfonts/fa-brands-400.woff2 +0 -0
- data/assets/webfonts/fa-regular-400.eot +0 -0
- data/assets/webfonts/fa-regular-400.svg +803 -0
- data/assets/webfonts/fa-regular-400.ttf +0 -0
- data/assets/webfonts/fa-regular-400.woff +0 -0
- data/assets/webfonts/fa-regular-400.woff2 +0 -0
- data/assets/webfonts/fa-solid-900.eot +0 -0
- data/assets/webfonts/fa-solid-900.svg +4649 -0
- data/assets/webfonts/fa-solid-900.ttf +0 -0
- data/assets/webfonts/fa-solid-900.woff +0 -0
- data/assets/webfonts/fa-solid-900.woff2 +0 -0
- data/sitemap.md +4 -0
- metadata +192 -0
@@ -0,0 +1,90 @@
|
|
1
|
+
/// Removes a specific item from a list.
|
2
|
+
/// @author Hugo Giraudel
|
3
|
+
/// @param {list} $list List.
|
4
|
+
/// @param {integer} $index Index.
|
5
|
+
/// @return {list} Updated list.
|
6
|
+
@function remove-nth($list, $index) {
|
7
|
+
|
8
|
+
$result: null;
|
9
|
+
|
10
|
+
@if type-of($index) != number {
|
11
|
+
@warn "$index: #{quote($index)} is not a number for `remove-nth`.";
|
12
|
+
}
|
13
|
+
@else if $index == 0 {
|
14
|
+
@warn "List index 0 must be a non-zero integer for `remove-nth`.";
|
15
|
+
}
|
16
|
+
@else if abs($index) > length($list) {
|
17
|
+
@warn "List index is #{$index} but list is only #{length($list)} item long for `remove-nth`.";
|
18
|
+
}
|
19
|
+
@else {
|
20
|
+
|
21
|
+
$result: ();
|
22
|
+
$index: if($index < 0, length($list) + $index + 1, $index);
|
23
|
+
|
24
|
+
@for $i from 1 through length($list) {
|
25
|
+
|
26
|
+
@if $i != $index {
|
27
|
+
$result: append($result, nth($list, $i));
|
28
|
+
}
|
29
|
+
|
30
|
+
}
|
31
|
+
|
32
|
+
}
|
33
|
+
|
34
|
+
@return $result;
|
35
|
+
|
36
|
+
}
|
37
|
+
|
38
|
+
/// Gets a value from a map.
|
39
|
+
/// @author Hugo Giraudel
|
40
|
+
/// @param {map} $map Map.
|
41
|
+
/// @param {string} $keys Key(s).
|
42
|
+
/// @return {string} Value.
|
43
|
+
@function val($map, $keys...) {
|
44
|
+
|
45
|
+
@if nth($keys, 1) == null {
|
46
|
+
$keys: remove-nth($keys, 1);
|
47
|
+
}
|
48
|
+
|
49
|
+
@each $key in $keys {
|
50
|
+
$map: map-get($map, $key);
|
51
|
+
}
|
52
|
+
|
53
|
+
@return $map;
|
54
|
+
|
55
|
+
}
|
56
|
+
|
57
|
+
/// Gets a duration value.
|
58
|
+
/// @param {string} $keys Key(s).
|
59
|
+
/// @return {string} Value.
|
60
|
+
@function _duration($keys...) {
|
61
|
+
@return val($duration, $keys...);
|
62
|
+
}
|
63
|
+
|
64
|
+
/// Gets a font value.
|
65
|
+
/// @param {string} $keys Key(s).
|
66
|
+
/// @return {string} Value.
|
67
|
+
@function _font($keys...) {
|
68
|
+
@return val($font, $keys...);
|
69
|
+
}
|
70
|
+
|
71
|
+
/// Gets a misc value.
|
72
|
+
/// @param {string} $keys Key(s).
|
73
|
+
/// @return {string} Value.
|
74
|
+
@function _misc($keys...) {
|
75
|
+
@return val($misc, $keys...);
|
76
|
+
}
|
77
|
+
|
78
|
+
/// Gets a palette value.
|
79
|
+
/// @param {string} $keys Key(s).
|
80
|
+
/// @return {string} Value.
|
81
|
+
@function _palette($keys...) {
|
82
|
+
@return val($palette, $keys...);
|
83
|
+
}
|
84
|
+
|
85
|
+
/// Gets a size value.
|
86
|
+
/// @param {string} $keys Key(s).
|
87
|
+
/// @return {string} Value.
|
88
|
+
@function _size($keys...) {
|
89
|
+
@return val($size, $keys...);
|
90
|
+
}
|
@@ -0,0 +1,78 @@
|
|
1
|
+
/// Makes an element's :before pseudoelement a FontAwesome icon.
|
2
|
+
/// @param {string} $content Optional content value to use.
|
3
|
+
/// @param {string} $category Optional category to use.
|
4
|
+
/// @param {string} $where Optional pseudoelement to target (before or after).
|
5
|
+
@mixin icon($content: false, $category: regular, $where: before) {
|
6
|
+
|
7
|
+
text-decoration: none;
|
8
|
+
|
9
|
+
&:#{$where} {
|
10
|
+
|
11
|
+
@if $content {
|
12
|
+
content: $content;
|
13
|
+
}
|
14
|
+
|
15
|
+
-moz-osx-font-smoothing: grayscale;
|
16
|
+
-webkit-font-smoothing: antialiased;
|
17
|
+
display: inline-block;
|
18
|
+
font-style: normal;
|
19
|
+
font-variant: normal;
|
20
|
+
text-rendering: auto;
|
21
|
+
line-height: 1;
|
22
|
+
text-transform: none !important;
|
23
|
+
|
24
|
+
@if ($category == brands) {
|
25
|
+
font-family: 'Font Awesome 5 Brands';
|
26
|
+
}
|
27
|
+
@elseif ($category == solid) {
|
28
|
+
font-family: 'Font Awesome 5 Free';
|
29
|
+
font-weight: 900;
|
30
|
+
}
|
31
|
+
@else {
|
32
|
+
font-family: 'Font Awesome 5 Free';
|
33
|
+
font-weight: 400;
|
34
|
+
}
|
35
|
+
|
36
|
+
}
|
37
|
+
|
38
|
+
}
|
39
|
+
|
40
|
+
/// Applies padding to an element, taking the current element-margin value into account.
|
41
|
+
/// @param {mixed} $tb Top/bottom padding.
|
42
|
+
/// @param {mixed} $lr Left/right padding.
|
43
|
+
/// @param {list} $pad Optional extra padding (in the following order top, right, bottom, left)
|
44
|
+
/// @param {bool} $important If true, adds !important.
|
45
|
+
@mixin padding($tb, $lr, $pad: (0,0,0,0), $important: null) {
|
46
|
+
|
47
|
+
@if $important {
|
48
|
+
$important: '!important';
|
49
|
+
}
|
50
|
+
|
51
|
+
$x: 0.1em;
|
52
|
+
|
53
|
+
@if unit(_size(element-margin)) == 'rem' {
|
54
|
+
$x: 0.1rem;
|
55
|
+
}
|
56
|
+
|
57
|
+
padding: ($tb + nth($pad,1)) ($lr + nth($pad,2)) max($x, $tb - _size(element-margin) + nth($pad,3)) ($lr + nth($pad,4)) #{$important};
|
58
|
+
|
59
|
+
}
|
60
|
+
|
61
|
+
/// Encodes a SVG data URL so IE doesn't choke (via codepen.io/jakob-e/pen/YXXBrp).
|
62
|
+
/// @param {string} $svg SVG data URL.
|
63
|
+
/// @return {string} Encoded SVG data URL.
|
64
|
+
@function svg-url($svg) {
|
65
|
+
|
66
|
+
$svg: str-replace($svg, '"', '\'');
|
67
|
+
$svg: str-replace($svg, '%', '%25');
|
68
|
+
$svg: str-replace($svg, '<', '%3C');
|
69
|
+
$svg: str-replace($svg, '>', '%3E');
|
70
|
+
$svg: str-replace($svg, '&', '%26');
|
71
|
+
$svg: str-replace($svg, '#', '%23');
|
72
|
+
$svg: str-replace($svg, '{', '%7B');
|
73
|
+
$svg: str-replace($svg, '}', '%7D');
|
74
|
+
$svg: str-replace($svg, ';', '%3B');
|
75
|
+
|
76
|
+
@return url("data:image/svg+xml;charset=utf8,#{$svg}");
|
77
|
+
|
78
|
+
}
|
@@ -0,0 +1,49 @@
|
|
1
|
+
// Misc.
|
2
|
+
$misc: (
|
3
|
+
z-index-base: 10000,
|
4
|
+
gallery-lightbox-opacity: 0.875
|
5
|
+
);
|
6
|
+
|
7
|
+
// Duration.
|
8
|
+
$duration: (
|
9
|
+
transition: 0.2s,
|
10
|
+
gallery-lightbox-fadein: 0.5s
|
11
|
+
);
|
12
|
+
|
13
|
+
// Size.
|
14
|
+
$size: (
|
15
|
+
border-radius: 0.25rem,
|
16
|
+
element-height: 2.5rem,
|
17
|
+
element-margin: 1.5rem,
|
18
|
+
pad: 3.5rem,
|
19
|
+
pad-small-tb: 3.5rem * 0.825,
|
20
|
+
pad-small-lr: 3.5rem * 0.5,
|
21
|
+
span-fixed: 10rem,
|
22
|
+
span-variable: 10%
|
23
|
+
);
|
24
|
+
|
25
|
+
// Font.
|
26
|
+
$font: (
|
27
|
+
family: ('Source Sans Pro', Helvetica, sans-serif),
|
28
|
+
family-heading: (Arial, Helvetica, sans-serif),
|
29
|
+
family-fixed: ('Courier New', monospace),
|
30
|
+
weight: 300,
|
31
|
+
weight-bold: 400,
|
32
|
+
weight-heading: 700
|
33
|
+
);
|
34
|
+
|
35
|
+
// Palette.
|
36
|
+
$palette: (
|
37
|
+
bg: #2e2b37,
|
38
|
+
bg-alt: #e1e6e1,
|
39
|
+
fg: rgba(255,255,255,0.75),
|
40
|
+
fg-bold: rgba(255,255,255,0.875),
|
41
|
+
fg-light: rgba(255,255,255,0.5),
|
42
|
+
border: rgba(255,255,255,0.25),
|
43
|
+
border-bg: rgba(255,255,255,0.075),
|
44
|
+
border-bg-alt: rgba(255,255,255,0.125),
|
45
|
+
accent1: #726193,
|
46
|
+
accent2: #e37b7c,
|
47
|
+
accent3: #ffe4b4,
|
48
|
+
accent4: #353865
|
49
|
+
);
|
@@ -0,0 +1,376 @@
|
|
1
|
+
// vendor.scss v1.0 | @ajlkn | MIT licensed */
|
2
|
+
|
3
|
+
// Vars.
|
4
|
+
|
5
|
+
/// Vendor prefixes.
|
6
|
+
/// @var {list}
|
7
|
+
$vendor-prefixes: (
|
8
|
+
'-moz-',
|
9
|
+
'-webkit-',
|
10
|
+
'-ms-',
|
11
|
+
''
|
12
|
+
);
|
13
|
+
|
14
|
+
/// Properties that should be vendorized.
|
15
|
+
/// Data via caniuse.com, github.com/postcss/autoprefixer, and developer.mozilla.org
|
16
|
+
/// @var {list}
|
17
|
+
$vendor-properties: (
|
18
|
+
|
19
|
+
// Animation.
|
20
|
+
'animation',
|
21
|
+
'animation-delay',
|
22
|
+
'animation-direction',
|
23
|
+
'animation-duration',
|
24
|
+
'animation-fill-mode',
|
25
|
+
'animation-iteration-count',
|
26
|
+
'animation-name',
|
27
|
+
'animation-play-state',
|
28
|
+
'animation-timing-function',
|
29
|
+
|
30
|
+
// Appearance.
|
31
|
+
'appearance',
|
32
|
+
|
33
|
+
// Backdrop filter.
|
34
|
+
'backdrop-filter',
|
35
|
+
|
36
|
+
// Background image options.
|
37
|
+
'background-clip',
|
38
|
+
'background-origin',
|
39
|
+
'background-size',
|
40
|
+
|
41
|
+
// Box sizing.
|
42
|
+
'box-sizing',
|
43
|
+
|
44
|
+
// Clip path.
|
45
|
+
'clip-path',
|
46
|
+
|
47
|
+
// Filter effects.
|
48
|
+
'filter',
|
49
|
+
|
50
|
+
// Flexbox.
|
51
|
+
'align-content',
|
52
|
+
'align-items',
|
53
|
+
'align-self',
|
54
|
+
'flex',
|
55
|
+
'flex-basis',
|
56
|
+
'flex-direction',
|
57
|
+
'flex-flow',
|
58
|
+
'flex-grow',
|
59
|
+
'flex-shrink',
|
60
|
+
'flex-wrap',
|
61
|
+
'justify-content',
|
62
|
+
'order',
|
63
|
+
|
64
|
+
// Font feature.
|
65
|
+
'font-feature-settings',
|
66
|
+
'font-language-override',
|
67
|
+
'font-variant-ligatures',
|
68
|
+
|
69
|
+
// Font kerning.
|
70
|
+
'font-kerning',
|
71
|
+
|
72
|
+
// Fragmented borders and backgrounds.
|
73
|
+
'box-decoration-break',
|
74
|
+
|
75
|
+
// Grid layout.
|
76
|
+
'grid-column',
|
77
|
+
'grid-column-align',
|
78
|
+
'grid-column-end',
|
79
|
+
'grid-column-start',
|
80
|
+
'grid-row',
|
81
|
+
'grid-row-align',
|
82
|
+
'grid-row-end',
|
83
|
+
'grid-row-start',
|
84
|
+
'grid-template-columns',
|
85
|
+
'grid-template-rows',
|
86
|
+
|
87
|
+
// Hyphens.
|
88
|
+
'hyphens',
|
89
|
+
'word-break',
|
90
|
+
|
91
|
+
// Masks.
|
92
|
+
'mask',
|
93
|
+
'mask-border',
|
94
|
+
'mask-border-outset',
|
95
|
+
'mask-border-repeat',
|
96
|
+
'mask-border-slice',
|
97
|
+
'mask-border-source',
|
98
|
+
'mask-border-width',
|
99
|
+
'mask-clip',
|
100
|
+
'mask-composite',
|
101
|
+
'mask-image',
|
102
|
+
'mask-origin',
|
103
|
+
'mask-position',
|
104
|
+
'mask-repeat',
|
105
|
+
'mask-size',
|
106
|
+
|
107
|
+
// Multicolumn.
|
108
|
+
'break-after',
|
109
|
+
'break-before',
|
110
|
+
'break-inside',
|
111
|
+
'column-count',
|
112
|
+
'column-fill',
|
113
|
+
'column-gap',
|
114
|
+
'column-rule',
|
115
|
+
'column-rule-color',
|
116
|
+
'column-rule-style',
|
117
|
+
'column-rule-width',
|
118
|
+
'column-span',
|
119
|
+
'column-width',
|
120
|
+
'columns',
|
121
|
+
|
122
|
+
// Object fit.
|
123
|
+
'object-fit',
|
124
|
+
'object-position',
|
125
|
+
|
126
|
+
// Regions.
|
127
|
+
'flow-from',
|
128
|
+
'flow-into',
|
129
|
+
'region-fragment',
|
130
|
+
|
131
|
+
// Scroll snap points.
|
132
|
+
'scroll-snap-coordinate',
|
133
|
+
'scroll-snap-destination',
|
134
|
+
'scroll-snap-points-x',
|
135
|
+
'scroll-snap-points-y',
|
136
|
+
'scroll-snap-type',
|
137
|
+
|
138
|
+
// Shapes.
|
139
|
+
'shape-image-threshold',
|
140
|
+
'shape-margin',
|
141
|
+
'shape-outside',
|
142
|
+
|
143
|
+
// Tab size.
|
144
|
+
'tab-size',
|
145
|
+
|
146
|
+
// Text align last.
|
147
|
+
'text-align-last',
|
148
|
+
|
149
|
+
// Text decoration.
|
150
|
+
'text-decoration-color',
|
151
|
+
'text-decoration-line',
|
152
|
+
'text-decoration-skip',
|
153
|
+
'text-decoration-style',
|
154
|
+
|
155
|
+
// Text emphasis.
|
156
|
+
'text-emphasis',
|
157
|
+
'text-emphasis-color',
|
158
|
+
'text-emphasis-position',
|
159
|
+
'text-emphasis-style',
|
160
|
+
|
161
|
+
// Text size adjust.
|
162
|
+
'text-size-adjust',
|
163
|
+
|
164
|
+
// Text spacing.
|
165
|
+
'text-spacing',
|
166
|
+
|
167
|
+
// Transform.
|
168
|
+
'transform',
|
169
|
+
'transform-origin',
|
170
|
+
|
171
|
+
// Transform 3D.
|
172
|
+
'backface-visibility',
|
173
|
+
'perspective',
|
174
|
+
'perspective-origin',
|
175
|
+
'transform-style',
|
176
|
+
|
177
|
+
// Transition.
|
178
|
+
'transition',
|
179
|
+
'transition-delay',
|
180
|
+
'transition-duration',
|
181
|
+
'transition-property',
|
182
|
+
'transition-timing-function',
|
183
|
+
|
184
|
+
// Unicode bidi.
|
185
|
+
'unicode-bidi',
|
186
|
+
|
187
|
+
// User select.
|
188
|
+
'user-select',
|
189
|
+
|
190
|
+
// Writing mode.
|
191
|
+
'writing-mode',
|
192
|
+
|
193
|
+
);
|
194
|
+
|
195
|
+
/// Values that should be vendorized.
|
196
|
+
/// Data via caniuse.com, github.com/postcss/autoprefixer, and developer.mozilla.org
|
197
|
+
/// @var {list}
|
198
|
+
$vendor-values: (
|
199
|
+
|
200
|
+
// Cross fade.
|
201
|
+
'cross-fade',
|
202
|
+
|
203
|
+
// Element function.
|
204
|
+
'element',
|
205
|
+
|
206
|
+
// Filter function.
|
207
|
+
'filter',
|
208
|
+
|
209
|
+
// Flexbox.
|
210
|
+
'flex',
|
211
|
+
'inline-flex',
|
212
|
+
|
213
|
+
// Grab cursors.
|
214
|
+
'grab',
|
215
|
+
'grabbing',
|
216
|
+
|
217
|
+
// Gradients.
|
218
|
+
'linear-gradient',
|
219
|
+
'repeating-linear-gradient',
|
220
|
+
'radial-gradient',
|
221
|
+
'repeating-radial-gradient',
|
222
|
+
|
223
|
+
// Grid layout.
|
224
|
+
'grid',
|
225
|
+
'inline-grid',
|
226
|
+
|
227
|
+
// Image set.
|
228
|
+
'image-set',
|
229
|
+
|
230
|
+
// Intrinsic width.
|
231
|
+
'max-content',
|
232
|
+
'min-content',
|
233
|
+
'fit-content',
|
234
|
+
'fill',
|
235
|
+
'fill-available',
|
236
|
+
'stretch',
|
237
|
+
|
238
|
+
// Sticky position.
|
239
|
+
'sticky',
|
240
|
+
|
241
|
+
// Transform.
|
242
|
+
'transform',
|
243
|
+
|
244
|
+
// Zoom cursors.
|
245
|
+
'zoom-in',
|
246
|
+
'zoom-out',
|
247
|
+
|
248
|
+
);
|
249
|
+
|
250
|
+
// Functions.
|
251
|
+
|
252
|
+
/// Removes a specific item from a list.
|
253
|
+
/// @author Hugo Giraudel
|
254
|
+
/// @param {list} $list List.
|
255
|
+
/// @param {integer} $index Index.
|
256
|
+
/// @return {list} Updated list.
|
257
|
+
@function remove-nth($list, $index) {
|
258
|
+
|
259
|
+
$result: null;
|
260
|
+
|
261
|
+
@if type-of($index) != number {
|
262
|
+
@warn "$index: #{quote($index)} is not a number for `remove-nth`.";
|
263
|
+
}
|
264
|
+
@else if $index == 0 {
|
265
|
+
@warn "List index 0 must be a non-zero integer for `remove-nth`.";
|
266
|
+
}
|
267
|
+
@else if abs($index) > length($list) {
|
268
|
+
@warn "List index is #{$index} but list is only #{length($list)} item long for `remove-nth`.";
|
269
|
+
}
|
270
|
+
@else {
|
271
|
+
|
272
|
+
$result: ();
|
273
|
+
$index: if($index < 0, length($list) + $index + 1, $index);
|
274
|
+
|
275
|
+
@for $i from 1 through length($list) {
|
276
|
+
|
277
|
+
@if $i != $index {
|
278
|
+
$result: append($result, nth($list, $i));
|
279
|
+
}
|
280
|
+
|
281
|
+
}
|
282
|
+
|
283
|
+
}
|
284
|
+
|
285
|
+
@return $result;
|
286
|
+
|
287
|
+
}
|
288
|
+
|
289
|
+
/// Replaces a substring within another string.
|
290
|
+
/// @author Hugo Giraudel
|
291
|
+
/// @param {string} $string String.
|
292
|
+
/// @param {string} $search Substring.
|
293
|
+
/// @param {string} $replace Replacement.
|
294
|
+
/// @return {string} Updated string.
|
295
|
+
@function str-replace($string, $search, $replace: '') {
|
296
|
+
|
297
|
+
$index: str-index($string, $search);
|
298
|
+
|
299
|
+
@if $index {
|
300
|
+
@return str-slice($string, 1, $index - 1) + $replace + str-replace(str-slice($string, $index + str-length($search)), $search, $replace);
|
301
|
+
}
|
302
|
+
|
303
|
+
@return $string;
|
304
|
+
|
305
|
+
}
|
306
|
+
|
307
|
+
/// Replaces a substring within each string in a list.
|
308
|
+
/// @param {list} $strings List of strings.
|
309
|
+
/// @param {string} $search Substring.
|
310
|
+
/// @param {string} $replace Replacement.
|
311
|
+
/// @return {list} Updated list of strings.
|
312
|
+
@function str-replace-all($strings, $search, $replace: '') {
|
313
|
+
|
314
|
+
@each $string in $strings {
|
315
|
+
$strings: set-nth($strings, index($strings, $string), str-replace($string, $search, $replace));
|
316
|
+
}
|
317
|
+
|
318
|
+
@return $strings;
|
319
|
+
|
320
|
+
}
|
321
|
+
|
322
|
+
// Mixins.
|
323
|
+
|
324
|
+
/// Wraps @content in vendorized keyframe blocks.
|
325
|
+
/// @param {string} $name Name.
|
326
|
+
@mixin keyframes($name) {
|
327
|
+
|
328
|
+
@-moz-keyframes #{$name} { @content; }
|
329
|
+
@-webkit-keyframes #{$name} { @content; }
|
330
|
+
@-ms-keyframes #{$name} { @content; }
|
331
|
+
@keyframes #{$name} { @content; }
|
332
|
+
|
333
|
+
}
|
334
|
+
|
335
|
+
/// Vendorizes a declaration's property and/or value(s).
|
336
|
+
/// @param {string} $property Property.
|
337
|
+
/// @param {mixed} $value String/list of value(s).
|
338
|
+
@mixin vendor($property, $value) {
|
339
|
+
|
340
|
+
// Determine if property should expand.
|
341
|
+
$expandProperty: index($vendor-properties, $property);
|
342
|
+
|
343
|
+
// Determine if value should expand (and if so, add '-prefix-' placeholder).
|
344
|
+
$expandValue: false;
|
345
|
+
|
346
|
+
@each $x in $value {
|
347
|
+
@each $y in $vendor-values {
|
348
|
+
@if $y == str-slice($x, 1, str-length($y)) {
|
349
|
+
|
350
|
+
$value: set-nth($value, index($value, $x), '-prefix-' + $x);
|
351
|
+
$expandValue: true;
|
352
|
+
|
353
|
+
}
|
354
|
+
}
|
355
|
+
}
|
356
|
+
|
357
|
+
// Expand property?
|
358
|
+
@if $expandProperty {
|
359
|
+
@each $vendor in $vendor-prefixes {
|
360
|
+
#{$vendor}#{$property}: #{str-replace-all($value, '-prefix-', $vendor)};
|
361
|
+
}
|
362
|
+
}
|
363
|
+
|
364
|
+
// Expand just the value?
|
365
|
+
@elseif $expandValue {
|
366
|
+
@each $vendor in $vendor-prefixes {
|
367
|
+
#{$property}: #{str-replace-all($value, '-prefix-', $vendor)};
|
368
|
+
}
|
369
|
+
}
|
370
|
+
|
371
|
+
// Neither? Treat them as a normal declaration.
|
372
|
+
@else {
|
373
|
+
#{$property}: #{$value};
|
374
|
+
}
|
375
|
+
|
376
|
+
}
|