gerillass 1.6.2 → 2.0.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.
- package/README.md +20 -4
- package/SKILL.md +30 -32
- package/gerillass.json +188 -196
- package/package.json +2 -12
- package/scss/_gerillass.scss +8 -92
- package/scss/library/_adaptive.scss +4 -1
- package/scss/library/_after.scss +5 -2
- package/scss/library/_all-buttons.scss +6 -2
- package/scss/library/_all-text-inputs.scss +6 -2
- package/scss/library/_aspect-ratio.scss +27 -0
- package/scss/library/_background-dots.scss +12 -7
- package/scss/library/_background-image.scss +18 -11
- package/scss/library/_background-stripes.scss +14 -9
- package/scss/library/_before.scss +5 -2
- package/scss/library/_border-radius.scss +19 -15
- package/scss/library/_brand-logo.scss +3 -1
- package/scss/library/_breakpoint.scss +25 -20
- package/scss/library/_breakpointer.scss +4 -1
- package/scss/library/_center.scss +3 -1
- package/scss/library/_columnizer.scss +18 -13
- package/scss/library/_counter.scss +21 -18
- package/scss/library/_escape-to-parent.scss +3 -1
- package/scss/library/_except.scss +12 -8
- package/scss/library/_font-face.scss +17 -12
- package/scss/library/_index.scss +52 -0
- package/scss/library/_linear-gradient.scss +13 -7
- package/scss/library/_loadify.scss +15 -11
- package/scss/library/_only.scss +12 -8
- package/scss/library/_position.scss +10 -6
- package/scss/library/_radial-gradient.scss +15 -9
- package/scss/library/_remove.scss +17 -14
- package/scss/library/_reset-figure.scss +3 -1
- package/scss/library/_scissors.scss +24 -21
- package/scss/library/_smartphone.scss +10 -6
- package/scss/library/_sprite.scss +16 -12
- package/scss/library/_stretched-link.scss +3 -1
- package/scss/library/_tablet.scss +10 -6
- package/scss/library/_text-gradient.scss +13 -7
- package/scss/library/_text-shadow.scss +46 -40
- package/scss/library/_triangle.scss +15 -10
- package/scss/lists/_index.scss +8 -0
- package/scss/maps/_index.scss +8 -0
- package/scss/utilities/_clear-unit.scss +3 -1
- package/scss/utilities/_clear-whitespace.scss +9 -6
- package/scss/utilities/_convert-to-em.scss +5 -2
- package/scss/utilities/_convert-to-number.scss +10 -6
- package/scss/utilities/_fill-nulls.scss +18 -0
- package/scss/utilities/_font-sizer.scss +1 -1
- package/scss/utilities/_font-source.scss +15 -10
- package/scss/utilities/_index.scss +24 -0
- package/scss/utilities/_is-color.scss +8 -5
- package/scss/utilities/_is-gutter.scss +8 -5
- package/scss/utilities/_is-number.scss +4 -2
- package/scss/utilities/_is-time.scss +8 -3
- package/scss/utilities/_map-deep-get.scss +4 -2
- package/scss/utilities/_pixelify.scss +11 -7
- package/scss/utilities/_pseudo-selector.scss +4 -2
- package/scss/utilities/_remify.scss +3 -1
- package/scss/utilities/_shade.scss +10 -0
- package/scss/utilities/_shorthand-property.scss +13 -11
- package/scss/utilities/_tint.scss +10 -0
- package/scss/utilities/_validate-breakpoint.scss +9 -5
- package/scss/utilities/_validate-length.scss +10 -5
- package/scss/utilities/_validate-ratio.scss +27 -15
- package/scss/utilities/_validate-scissors.scss +16 -11
- package/scss/_gerillass-prefix.scss +0 -1586
- package/scss/library/_ratio-box.scss +0 -19
- package/scss/library/_responsive-video.scss +0 -19
- package/scss/utilities/_darken.scss +0 -7
- package/scss/utilities/_lighten.scss +0 -7
- package/scss/utilities/_null.scss +0 -16
|
@@ -1,25 +1,30 @@
|
|
|
1
1
|
@charset "UTF-8";
|
|
2
2
|
|
|
3
|
+
@use "sass:list";
|
|
4
|
+
@use "sass:meta";
|
|
5
|
+
@use "../library/border-box" as *;
|
|
6
|
+
@use "../utilities/is-gutter" as *;
|
|
7
|
+
|
|
3
8
|
@mixin columnizer($params...) {
|
|
4
|
-
@if length($params) < 1 or length($params) > 3 {
|
|
5
|
-
@error "`columnizer` takes 1 to 3 arguments; you passed #{length($params)}. Pass the column count, optionally a gutter length, and optionally a boolean telling the last row whether to fill.";
|
|
9
|
+
@if list.length($params) < 1 or list.length($params) > 3 {
|
|
10
|
+
@error "`columnizer` takes 1 to 3 arguments; you passed #{list.length($params)}. Pass the column count, optionally a gutter length, and optionally a boolean telling the last row whether to fill.";
|
|
6
11
|
}
|
|
7
|
-
$columns: nth($params, 1);
|
|
12
|
+
$columns: list.nth($params, 1);
|
|
8
13
|
$gutter: null;
|
|
9
14
|
$fill: false;
|
|
10
15
|
display: flex;
|
|
11
16
|
flex-wrap: wrap;
|
|
12
17
|
@include border-box;
|
|
13
18
|
> * {
|
|
14
|
-
@if length($params) == 1 {
|
|
19
|
+
@if list.length($params) == 1 {
|
|
15
20
|
flex: 0 0 calc(100% / #{$columns});
|
|
16
21
|
margin-bottom: 0;
|
|
17
22
|
&:not(:last-child) {
|
|
18
23
|
margin-right: 0;
|
|
19
24
|
}
|
|
20
|
-
} @else if length($params) == 2 {
|
|
21
|
-
@if type-of(nth($params, 2)) == bool {
|
|
22
|
-
$fill: nth($params, length($params));
|
|
25
|
+
} @else if list.length($params) == 2 {
|
|
26
|
+
@if meta.type-of(list.nth($params, 2)) == bool {
|
|
27
|
+
$fill: list.nth($params, list.length($params));
|
|
23
28
|
flex-grow: #{if($fill == true, 1, 0)};
|
|
24
29
|
flex-shrink: 0;
|
|
25
30
|
flex-basis: calc(100% / #{$columns});
|
|
@@ -27,8 +32,8 @@
|
|
|
27
32
|
&:not(:last-child) {
|
|
28
33
|
margin-right: 0;
|
|
29
34
|
}
|
|
30
|
-
} @else if
|
|
31
|
-
$gutter: nth($params, length($params));
|
|
35
|
+
} @else if isGutter(list.nth($params, 2)) {
|
|
36
|
+
$gutter: list.nth($params, list.length($params));
|
|
32
37
|
flex-grow: 0;
|
|
33
38
|
flex-shrink: 0;
|
|
34
39
|
flex-basis: calc((100% - (#{$columns} - 1) * #{$gutter}) / #{$columns});
|
|
@@ -40,11 +45,11 @@
|
|
|
40
45
|
margin-right: 0;
|
|
41
46
|
}
|
|
42
47
|
} @else {
|
|
43
|
-
@error "`#{nth($params, 2)}` is not a valid second argument for `columnizer`. Pass a gutter length such as `20px` or `var(--gap)`, or a boolean telling the last row whether to fill.";
|
|
48
|
+
@error "`#{list.nth($params, 2)}` is not a valid second argument for `columnizer`. Pass a gutter length such as `20px` or `var(--gap)`, or a boolean telling the last row whether to fill.";
|
|
44
49
|
}
|
|
45
|
-
} @else if length($params) == 3 {
|
|
46
|
-
$gutter: nth($params, 2);
|
|
47
|
-
$fill: nth($params, length($params));
|
|
50
|
+
} @else if list.length($params) == 3 {
|
|
51
|
+
$gutter: list.nth($params, 2);
|
|
52
|
+
$fill: list.nth($params, list.length($params));
|
|
48
53
|
flex-grow: if($fill == true, 1, 0);
|
|
49
54
|
flex-shrink: 0;
|
|
50
55
|
flex-basis: calc((100% - (#{$columns} - 1) * #{$gutter}) / #{$columns});
|
|
@@ -1,32 +1,35 @@
|
|
|
1
1
|
@charset "UTF-8";
|
|
2
2
|
|
|
3
|
+
@use "sass:list";
|
|
4
|
+
@use "../lists/list-of-counter-styles" as *;
|
|
5
|
+
|
|
3
6
|
@mixin counter($params...) {
|
|
4
7
|
$counter: null;
|
|
5
8
|
$counter-before: null;
|
|
6
9
|
$counter-after: null;
|
|
7
10
|
|
|
8
|
-
@if length($params) == 1 {
|
|
9
|
-
@if index($list-of-counter-styles, nth($params, 1)) {
|
|
10
|
-
$counter: nth($params, 1);
|
|
11
|
+
@if list.length($params) == 1 {
|
|
12
|
+
@if list.index($list-of-counter-styles, list.nth($params, 1)) {
|
|
13
|
+
$counter: list.nth($params, 1);
|
|
11
14
|
} @else {
|
|
12
|
-
$counter-after: nth($params, 1);
|
|
15
|
+
$counter-after: list.nth($params, 1);
|
|
13
16
|
}
|
|
14
|
-
} @else if length($params) == 2 {
|
|
15
|
-
@if index($list-of-counter-styles, nth($params, 1)) {
|
|
16
|
-
$counter: nth($params, 1);
|
|
17
|
-
$counter-after: nth($params, 2);
|
|
18
|
-
} @else if index($list-of-counter-styles, nth($params, 2)) {
|
|
19
|
-
$counter-before: nth($params, 1);
|
|
20
|
-
$counter: nth($params, 2);
|
|
17
|
+
} @else if list.length($params) == 2 {
|
|
18
|
+
@if list.index($list-of-counter-styles, list.nth($params, 1)) {
|
|
19
|
+
$counter: list.nth($params, 1);
|
|
20
|
+
$counter-after: list.nth($params, 2);
|
|
21
|
+
} @else if list.index($list-of-counter-styles, list.nth($params, 2)) {
|
|
22
|
+
$counter-before: list.nth($params, 1);
|
|
23
|
+
$counter: list.nth($params, 2);
|
|
21
24
|
} @else {
|
|
22
|
-
$counter-before: nth($params, 1);
|
|
23
|
-
$counter-after: nth($params, 2);
|
|
25
|
+
$counter-before: list.nth($params, 1);
|
|
26
|
+
$counter-after: list.nth($params, 2);
|
|
24
27
|
}
|
|
25
|
-
} @else if length($params) == 3 {
|
|
26
|
-
@if index($list-of-counter-styles, nth($params, 2)) {
|
|
27
|
-
$counter-before: nth($params, 1);
|
|
28
|
-
$counter: nth($params, 2);
|
|
29
|
-
$counter-after: nth($params, 3);
|
|
28
|
+
} @else if list.length($params) == 3 {
|
|
29
|
+
@if list.index($list-of-counter-styles, list.nth($params, 2)) {
|
|
30
|
+
$counter-before: list.nth($params, 1);
|
|
31
|
+
$counter: list.nth($params, 2);
|
|
32
|
+
$counter-after: list.nth($params, 3);
|
|
30
33
|
}
|
|
31
34
|
}
|
|
32
35
|
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
@charset "UTF-8";
|
|
2
2
|
|
|
3
|
+
@use "sass:meta";
|
|
4
|
+
|
|
3
5
|
@mixin escape-to-parent($selector: null) {
|
|
4
|
-
@if $selector != null and type-of($selector) != "string" {
|
|
6
|
+
@if $selector != null and meta.type-of($selector) != "string" {
|
|
5
7
|
@error "`#{$selector}` is not a valid $selector for `escape-to-parent`. Pass a selector as a string, such as `\".theme-dark\"`.";
|
|
6
8
|
}
|
|
7
9
|
@at-root #{$selector}#{&} {
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
@charset "UTF-8";
|
|
2
2
|
|
|
3
|
+
@use "sass:list";
|
|
4
|
+
@use "sass:meta";
|
|
5
|
+
@use "sass:string";
|
|
6
|
+
|
|
3
7
|
@mixin except($params...) {
|
|
4
|
-
@if length($params) == 0 {
|
|
8
|
+
@if list.length($params) == 0 {
|
|
5
9
|
@error "Please pass an argument. The argument must be either a negative or positive number or list of numbers. Or pass one of the following predefined string values: 'first', 'last', 'odd', 'even'.";
|
|
6
|
-
} @else if length($params) == 1 {
|
|
7
|
-
$value: nth($params, 1);
|
|
8
|
-
@if type-of($value) == "number" {
|
|
10
|
+
} @else if list.length($params) == 1 {
|
|
11
|
+
$value: list.nth($params, 1);
|
|
12
|
+
@if meta.type-of($value) == "number" {
|
|
9
13
|
@if $value < 0 {
|
|
10
14
|
&:not(:nth-last-of-type(#{$value * -1})) {
|
|
11
15
|
@content;
|
|
@@ -15,7 +19,7 @@
|
|
|
15
19
|
@content;
|
|
16
20
|
}
|
|
17
21
|
}
|
|
18
|
-
} @else if type-of($value) == "string" {
|
|
22
|
+
} @else if meta.type-of($value) == "string" {
|
|
19
23
|
@if $value == "odd" {
|
|
20
24
|
&:not(:nth-of-type(odd)) {
|
|
21
25
|
@content;
|
|
@@ -40,10 +44,10 @@
|
|
|
40
44
|
} @else {
|
|
41
45
|
@error "`#{$value}` is not a valid argument for `except`. Pass a positive or negative number, one of `first`, `last`, `odd`, `even`, or a selector such as `.foo`.";
|
|
42
46
|
}
|
|
43
|
-
} @else if length($params) > 1 {
|
|
47
|
+
} @else if list.length($params) > 1 {
|
|
44
48
|
$items: "";
|
|
45
|
-
@for $i from 1 through length($params) {
|
|
46
|
-
$items: $items + if(nth($params, $i) < 0, unquote(":not(:nth-last-of-type(#{nth($params, $i) * -1}))"), unquote(":not(:nth-of-type(#{nth($params, $i)}))"));
|
|
49
|
+
@for $i from 1 through list.length($params) {
|
|
50
|
+
$items: $items + if(list.nth($params, $i) < 0, string.unquote(":not(:nth-last-of-type(#{list.nth($params, $i) * -1}))"), string.unquote(":not(:nth-of-type(#{list.nth($params, $i)}))"));
|
|
47
51
|
}
|
|
48
52
|
&#{$items} {
|
|
49
53
|
@content;
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
@charset "UTF-8";
|
|
2
2
|
|
|
3
|
+
@use "sass:list";
|
|
4
|
+
@use "sass:meta";
|
|
5
|
+
@use "sass:string";
|
|
6
|
+
@use "../utilities/font-source" as *;
|
|
7
|
+
|
|
3
8
|
@mixin font-face(
|
|
4
9
|
$font-family,
|
|
5
10
|
$file-path,
|
|
@@ -9,28 +14,28 @@
|
|
|
9
14
|
) {
|
|
10
15
|
@if & {
|
|
11
16
|
@error "You must call the mixin at the root level of your style sheet, not in the `#{&+'{'+'}'}` selector.";
|
|
12
|
-
} @else if type-of($font-family) != "string" {
|
|
17
|
+
} @else if meta.type-of($font-family) != "string" {
|
|
13
18
|
@error "`#{$font-family}` is not a valid $font-family for `font-face`. Pass the family name as a string, such as `\"Inter\"`.";
|
|
14
|
-
} @else if type-of($file-path) != "string" {
|
|
19
|
+
} @else if meta.type-of($file-path) != "string" {
|
|
15
20
|
@error "`#{$file-path}` is not a valid $file-path for `font-face`. Pass the path to the font files without an extension, as a string.";
|
|
16
21
|
} @else {
|
|
17
22
|
|
|
18
23
|
$list: ();
|
|
19
24
|
|
|
20
|
-
@if index(100 200 300 400 500 600 700 800 900, $font-style) {
|
|
25
|
+
@if list.index(100 200 300 400 500 600 700 800 900, $font-style) {
|
|
21
26
|
$font-weight: $font-style;
|
|
22
27
|
$font-style: normal;
|
|
23
28
|
} @else if not
|
|
24
|
-
index("normal" "italic" "oblique", $font-style) and
|
|
25
|
-
type-of($font-style) !=
|
|
29
|
+
list.index("normal" "italic" "oblique", $font-style) and
|
|
30
|
+
meta.type-of($font-style) !=
|
|
26
31
|
"number"
|
|
27
32
|
{
|
|
28
33
|
$font-style-list: ();
|
|
29
|
-
@for $i from 1 through length($font-style) {
|
|
30
|
-
$font-style-list: append($font-style-list, nth($font-style, $i), comma);
|
|
34
|
+
@for $i from 1 through list.length($font-style) {
|
|
35
|
+
$font-style-list: list.append($font-style-list, list.nth($font-style, $i), comma);
|
|
31
36
|
}
|
|
32
|
-
@for $i from 1 through length($font-style-list) {
|
|
33
|
-
@if index("eot" "woff2" "woff" "ttf" "svg", nth($font-style-list, $i)) {
|
|
37
|
+
@for $i from 1 through list.length($font-style-list) {
|
|
38
|
+
@if list.index("eot" "woff2" "woff" "ttf" "svg", list.nth($font-style-list, $i)) {
|
|
34
39
|
$file-formats: $font-style-list;
|
|
35
40
|
$font-style: normal;
|
|
36
41
|
}
|
|
@@ -39,11 +44,11 @@
|
|
|
39
44
|
|
|
40
45
|
@font-face {
|
|
41
46
|
font-family: $font-family;
|
|
42
|
-
@if index($file-formats, eot) {
|
|
47
|
+
@if list.index($file-formats, eot) {
|
|
43
48
|
src: url("#{$file-path}.eot");
|
|
44
49
|
}
|
|
45
|
-
@for $i from 1 through length($file-formats) {
|
|
46
|
-
$list: append($list,
|
|
50
|
+
@for $i from 1 through list.length($file-formats) {
|
|
51
|
+
$list: list.append($list, fontSource($font-family, $file-path, list.nth($file-formats, $i)), comma);
|
|
47
52
|
}
|
|
48
53
|
src: $list;
|
|
49
54
|
font-style: $font-style;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
@charset "UTF-8";
|
|
2
|
+
|
|
3
|
+
@forward "adaptive";
|
|
4
|
+
@forward "after";
|
|
5
|
+
@forward "all-buttons";
|
|
6
|
+
@forward "all-text-inputs";
|
|
7
|
+
@forward "antialias";
|
|
8
|
+
@forward "aspect-ratio";
|
|
9
|
+
@forward "background-dots";
|
|
10
|
+
@forward "background-image";
|
|
11
|
+
@forward "background-stripes";
|
|
12
|
+
@forward "before";
|
|
13
|
+
@forward "border-box";
|
|
14
|
+
@forward "border-radius";
|
|
15
|
+
@forward "brand-logo";
|
|
16
|
+
@forward "breakpoint";
|
|
17
|
+
@forward "breakpointer";
|
|
18
|
+
@forward "center";
|
|
19
|
+
@forward "circle";
|
|
20
|
+
@forward "clearfix";
|
|
21
|
+
@forward "columnizer";
|
|
22
|
+
@forward "counter";
|
|
23
|
+
@forward "ellipsis";
|
|
24
|
+
@forward "escape-to-parent";
|
|
25
|
+
@forward "except";
|
|
26
|
+
@forward "font-face";
|
|
27
|
+
@forward "hide";
|
|
28
|
+
@forward "linear-gradient";
|
|
29
|
+
@forward "loadify";
|
|
30
|
+
@forward "only";
|
|
31
|
+
@forward "placeholder";
|
|
32
|
+
@forward "placeholder-shown";
|
|
33
|
+
@forward "position";
|
|
34
|
+
@forward "radial-gradient";
|
|
35
|
+
@forward "remove";
|
|
36
|
+
@forward "reset-css";
|
|
37
|
+
@forward "reset-figure";
|
|
38
|
+
@forward "resizable";
|
|
39
|
+
@forward "responsive-image";
|
|
40
|
+
@forward "scissors";
|
|
41
|
+
@forward "screen-agent";
|
|
42
|
+
@forward "sizer";
|
|
43
|
+
@forward "smartphone";
|
|
44
|
+
@forward "sprite";
|
|
45
|
+
@forward "stretched-link";
|
|
46
|
+
@forward "tablet";
|
|
47
|
+
@forward "text-gradient";
|
|
48
|
+
@forward "text-image";
|
|
49
|
+
@forward "text-selection";
|
|
50
|
+
@forward "text-shadow";
|
|
51
|
+
@forward "text-stroke";
|
|
52
|
+
@forward "triangle";
|
|
@@ -1,18 +1,24 @@
|
|
|
1
1
|
@charset "UTF-8";
|
|
2
2
|
|
|
3
|
+
@use "sass:list";
|
|
4
|
+
@use "sass:map";
|
|
5
|
+
@use "sass:math";
|
|
6
|
+
@use "sass:meta";
|
|
7
|
+
@use "../maps/map-for-directions" as *;
|
|
8
|
+
|
|
3
9
|
@mixin linear-gradient($direction, $colors) {
|
|
4
10
|
$list: ();
|
|
5
|
-
@for $i from 1 through length($colors) {
|
|
6
|
-
$list: append($list, nth($colors, $i), comma);
|
|
11
|
+
@for $i from 1 through list.length($colors) {
|
|
12
|
+
$list: list.append($list, list.nth($colors, $i), comma);
|
|
7
13
|
}
|
|
8
|
-
@if map
|
|
14
|
+
@if map.has-key($map-for-directions, $direction) {
|
|
9
15
|
background: linear-gradient(
|
|
10
|
-
map
|
|
16
|
+
map.get($map-for-directions, $direction),
|
|
11
17
|
$list
|
|
12
18
|
);
|
|
13
|
-
} @else if not map
|
|
14
|
-
@if type-of($direction) != "number" or not index("deg", unit($direction)) {
|
|
15
|
-
@error "`#{$direction}` is not a valid $direction for `linear-gradient`. Pass an angle such as `45deg`, or one of: #{map
|
|
19
|
+
} @else if not map.has-key($map-for-directions, $direction) {
|
|
20
|
+
@if meta.type-of($direction) != "number" or not list.index("deg", math.unit($direction)) {
|
|
21
|
+
@error "`#{$direction}` is not a valid $direction for `linear-gradient`. Pass an angle such as `45deg`, or one of: #{map.keys($map-for-directions)}.";
|
|
16
22
|
} @else {
|
|
17
23
|
background: linear-gradient($direction, $list);
|
|
18
24
|
}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
@charset "UTF-8";
|
|
2
2
|
|
|
3
|
+
@use "sass:list";
|
|
4
|
+
@use "sass:meta";
|
|
5
|
+
@use "../utilities/is-time" as *;
|
|
6
|
+
|
|
3
7
|
@mixin loadify($params...) {
|
|
4
8
|
@if not & {
|
|
5
|
-
@if length($params) == 0 or (length($params) == 1 and nth($params, 1) == "init") {
|
|
9
|
+
@if list.length($params) == 0 or (list.length($params) == 1 and list.nth($params, 1) == "init") {
|
|
6
10
|
@keyframes loadify {
|
|
7
11
|
to {
|
|
8
12
|
opacity: 1;
|
|
@@ -17,23 +21,23 @@
|
|
|
17
21
|
animation-name: loadify;
|
|
18
22
|
animation-fill-mode: forwards;
|
|
19
23
|
}
|
|
20
|
-
} @else if (length($params) == 1 and nth($params, 1) != "init") or (length($params) == 1 and type-of(nth($params, 1)) != "string") {
|
|
21
|
-
@error "#{nth($params, 1)} is not a valid argument. Please pass `init` as an argument to initialize the effect or do not pass any argument at all.";
|
|
22
|
-
} @else if length($params) > 1 {
|
|
24
|
+
} @else if (list.length($params) == 1 and list.nth($params, 1) != "init") or (list.length($params) == 1 and meta.type-of(list.nth($params, 1)) != "string") {
|
|
25
|
+
@error "#{list.nth($params, 1)} is not a valid argument. Please pass `init` as an argument to initialize the effect or do not pass any argument at all.";
|
|
26
|
+
} @else if list.length($params) > 1 {
|
|
23
27
|
@error "Only one argument is allowed when you call this mixin at the root of your stylesheet! Please pass `init` as an argument to initialize the effect or do not pass any argument at all.";
|
|
24
28
|
}
|
|
25
29
|
} @else if & {
|
|
26
30
|
@extend %loadify;
|
|
27
|
-
@if length($params) == 0 {
|
|
31
|
+
@if list.length($params) == 0 {
|
|
28
32
|
animation-delay: 0.2s;
|
|
29
33
|
animation-duration: 0.5s;
|
|
30
|
-
} @else if length($params) == 1 {
|
|
31
|
-
animation-delay: #{
|
|
34
|
+
} @else if list.length($params) == 1 {
|
|
35
|
+
animation-delay: #{isTime(list.nth($params, 1))};
|
|
32
36
|
animation-duration: 0.5s;
|
|
33
|
-
} @else if length($params) == 2 {
|
|
34
|
-
animation-delay: #{
|
|
35
|
-
animation-duration: #{
|
|
36
|
-
} @else if length($params) > 2 {
|
|
37
|
+
} @else if list.length($params) == 2 {
|
|
38
|
+
animation-delay: #{isTime(list.nth($params, 1))};
|
|
39
|
+
animation-duration: #{isTime(list.nth($params, 2))};
|
|
40
|
+
} @else if list.length($params) > 2 {
|
|
37
41
|
@error "You cannot pass more than two arguments.";
|
|
38
42
|
}
|
|
39
43
|
}
|
package/scss/library/_only.scss
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
@charset "UTF-8";
|
|
2
2
|
|
|
3
|
+
@use "sass:list";
|
|
4
|
+
@use "sass:meta";
|
|
5
|
+
@use "sass:string";
|
|
6
|
+
|
|
3
7
|
@mixin only($params...) {
|
|
4
|
-
@if length($params) == 0 {
|
|
8
|
+
@if list.length($params) == 0 {
|
|
5
9
|
@error "Please pass an argument. The argument must be either a negative or positive number or list of numbers. Or pass one of the following predefined string values: 'first', 'last', 'odd', 'even'.";
|
|
6
|
-
} @else if length($params) == 1 {
|
|
7
|
-
$value: nth($params, 1);
|
|
8
|
-
@if type-of($value) == "number" {
|
|
10
|
+
} @else if list.length($params) == 1 {
|
|
11
|
+
$value: list.nth($params, 1);
|
|
12
|
+
@if meta.type-of($value) == "number" {
|
|
9
13
|
@if $value < 0 {
|
|
10
14
|
&:nth-last-of-type(#{$value * -1}) {
|
|
11
15
|
@content;
|
|
@@ -15,7 +19,7 @@
|
|
|
15
19
|
@content;
|
|
16
20
|
}
|
|
17
21
|
}
|
|
18
|
-
} @else if type-of($value) == "string" {
|
|
22
|
+
} @else if meta.type-of($value) == "string" {
|
|
19
23
|
@if $value == "odd" {
|
|
20
24
|
&:nth-of-type(odd) {
|
|
21
25
|
@content;
|
|
@@ -41,10 +45,10 @@
|
|
|
41
45
|
} @else {
|
|
42
46
|
@error "`#{$value}` is not a valid argument for `only`. Pass a positive or negative number, one of `first`, `last`, `odd`, `even`, or a selector such as `.foo`.";
|
|
43
47
|
}
|
|
44
|
-
} @else if length($params) > 1 {
|
|
48
|
+
} @else if list.length($params) > 1 {
|
|
45
49
|
$list: ();
|
|
46
|
-
@for $i from 1 through length($params) {
|
|
47
|
-
$list: append($list, if(nth($params, $i) < 0, unquote("&:nth-last-of-type(#{nth($params, $i) * -1})"), unquote("&:nth-of-type(#{nth($params, $i)})")), comma);
|
|
50
|
+
@for $i from 1 through list.length($params) {
|
|
51
|
+
$list: list.append($list, if(list.nth($params, $i) < 0, string.unquote("&:nth-last-of-type(#{list.nth($params, $i) * -1})"), string.unquote("&:nth-of-type(#{list.nth($params, $i)})")), comma);
|
|
48
52
|
}
|
|
49
53
|
#{$list} {
|
|
50
54
|
@content;
|
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
@charset "UTF-8";
|
|
2
2
|
|
|
3
|
+
@use "sass:list";
|
|
4
|
+
@use "../utilities/shorthand-property" as *;
|
|
5
|
+
@use "../utilities/validate-length" as *;
|
|
6
|
+
|
|
3
7
|
@mixin position($position: absolute, $offsets: 0) {
|
|
4
|
-
$offsets:
|
|
8
|
+
$offsets: shorthandProperty($offsets);
|
|
5
9
|
$positioning-offsets: (
|
|
6
|
-
top: nth($offsets, 1),
|
|
7
|
-
right: nth($offsets, 2),
|
|
8
|
-
bottom: nth($offsets, 3),
|
|
9
|
-
left: nth($offsets, 4),
|
|
10
|
+
top: list.nth($offsets, 1),
|
|
11
|
+
right: list.nth($offsets, 2),
|
|
12
|
+
bottom: list.nth($offsets, 3),
|
|
13
|
+
left: list.nth($offsets, 4),
|
|
10
14
|
);
|
|
11
15
|
position: $position;
|
|
12
16
|
@each $offset, $value in $positioning-offsets {
|
|
13
|
-
@if
|
|
17
|
+
@if validateLength($value) {
|
|
14
18
|
#{$offset}: $value;
|
|
15
19
|
}
|
|
16
20
|
}
|
|
@@ -1,24 +1,30 @@
|
|
|
1
1
|
@charset "UTF-8";
|
|
2
2
|
|
|
3
|
+
@use "sass:list";
|
|
4
|
+
@use "sass:map";
|
|
5
|
+
@use "sass:meta";
|
|
6
|
+
@use "sass:string";
|
|
7
|
+
@use "../maps/map-for-positions" as *;
|
|
8
|
+
|
|
3
9
|
@mixin radial-gradient($shape, $position, $colors) {
|
|
4
|
-
@if type-of($shape) != "string" {
|
|
10
|
+
@if meta.type-of($shape) != "string" {
|
|
5
11
|
@error "`#{$shape}` is not a valid $shape for `radial-gradient`. Pass `circle` or `ellipse`.";
|
|
6
12
|
}
|
|
7
|
-
@if type-of($position) != "string" {
|
|
13
|
+
@if meta.type-of($position) != "string" {
|
|
8
14
|
@error "`#{$position}` is not a valid $position for `radial-gradient`. Pass a position name such as `center` or `top-left`, or a raw CSS position as a string.";
|
|
9
15
|
}
|
|
10
16
|
$list: ();
|
|
11
|
-
$shape: unquote($shape);
|
|
12
|
-
$position: unquote($position);
|
|
13
|
-
@for $i from 1 through length($colors) {
|
|
14
|
-
$list: append($list, nth($colors, $i), comma);
|
|
17
|
+
$shape: string.unquote($shape);
|
|
18
|
+
$position: string.unquote($position);
|
|
19
|
+
@for $i from 1 through list.length($colors) {
|
|
20
|
+
$list: list.append($list, list.nth($colors, $i), comma);
|
|
15
21
|
}
|
|
16
|
-
@if map
|
|
22
|
+
@if map.has-key($map-for-positions, $position) {
|
|
17
23
|
background: radial-gradient(
|
|
18
|
-
$shape map
|
|
24
|
+
$shape map.get($map-for-positions, $position),
|
|
19
25
|
$list
|
|
20
26
|
);
|
|
21
|
-
} @else if not map
|
|
27
|
+
} @else if not map.has-key($map-for-positions, $position) {
|
|
22
28
|
background: radial-gradient($shape $position, $list);
|
|
23
29
|
}
|
|
24
30
|
}
|
|
@@ -1,34 +1,37 @@
|
|
|
1
1
|
@charset "UTF-8";
|
|
2
2
|
|
|
3
|
+
@use "sass:list";
|
|
4
|
+
@use "../library/breakpoint" as *;
|
|
5
|
+
|
|
3
6
|
@mixin remove($params...) {
|
|
4
|
-
@if length($params) == 0 {
|
|
7
|
+
@if list.length($params) == 0 {
|
|
5
8
|
display: none;
|
|
6
|
-
} @else if length($params) == 1 {
|
|
7
|
-
$value: nth($params, 1);
|
|
8
|
-
@include
|
|
9
|
+
} @else if list.length($params) == 1 {
|
|
10
|
+
$value: list.nth($params, 1);
|
|
11
|
+
@include breakpoint($value) {
|
|
9
12
|
display: none;
|
|
10
13
|
}
|
|
11
|
-
} @else if length($params) == 2 {
|
|
12
|
-
@if index("min" "max", nth($params, 1)) {
|
|
13
|
-
$mode: nth($params, 1);
|
|
14
|
-
$value: nth($params, 2);
|
|
14
|
+
} @else if list.length($params) == 2 {
|
|
15
|
+
@if list.index("min" "max", list.nth($params, 1)) {
|
|
16
|
+
$mode: list.nth($params, 1);
|
|
17
|
+
$value: list.nth($params, 2);
|
|
15
18
|
@if $mode == "min" {
|
|
16
|
-
@include
|
|
19
|
+
@include breakpoint(min, $value) {
|
|
17
20
|
display: none;
|
|
18
21
|
}
|
|
19
22
|
} @else if $mode == "max" {
|
|
20
|
-
@include
|
|
23
|
+
@include breakpoint(max, $value) {
|
|
21
24
|
display: none;
|
|
22
25
|
}
|
|
23
26
|
}
|
|
24
27
|
} @else {
|
|
25
|
-
$start: nth($params, 1);
|
|
26
|
-
$end: nth($params, 2);
|
|
27
|
-
@include
|
|
28
|
+
$start: list.nth($params, 1);
|
|
29
|
+
$end: list.nth($params, 2);
|
|
30
|
+
@include breakpoint($start, $end) {
|
|
28
31
|
display: none;
|
|
29
32
|
}
|
|
30
33
|
}
|
|
31
34
|
} @else {
|
|
32
|
-
@error "`remove` takes at most 2 arguments; you passed #{length($params)}. Pass nothing to hide the element outright, one breakpoint, `min`/`max` plus a breakpoint, or a start and an end breakpoint.";
|
|
35
|
+
@error "`remove` takes at most 2 arguments; you passed #{list.length($params)}. Pass nothing to hide the element outright, one breakpoint, `min`/`max` plus a breakpoint, or a start and an end breakpoint.";
|
|
33
36
|
}
|
|
34
37
|
}
|
|
@@ -1,31 +1,34 @@
|
|
|
1
1
|
@charset "UTF-8";
|
|
2
2
|
|
|
3
|
+
@use "sass:list";
|
|
4
|
+
@use "../utilities/validate-scissors" as *;
|
|
5
|
+
|
|
3
6
|
@mixin scissors($corners) {
|
|
4
|
-
@if length($corners) == 1 {
|
|
5
|
-
$corners:
|
|
7
|
+
@if list.length($corners) == 1 {
|
|
8
|
+
$corners: validateScissors($corners);
|
|
6
9
|
clip-path: polygon(
|
|
7
|
-
0 #{nth($corners, 1)},
|
|
8
|
-
#{nth($corners, 1)} 0,
|
|
9
|
-
calc(100% - #{nth($corners, 1)}) 0,
|
|
10
|
-
100% #{nth($corners, 1)},
|
|
11
|
-
100% calc(100% - #{nth($corners, 1)}),
|
|
12
|
-
calc(100% - #{nth($corners, 1)}) 100%,
|
|
13
|
-
#{nth($corners, 1)} 100%,
|
|
14
|
-
0 calc(100% - #{nth($corners, 1)})
|
|
10
|
+
0 #{list.nth($corners, 1)},
|
|
11
|
+
#{list.nth($corners, 1)} 0,
|
|
12
|
+
calc(100% - #{list.nth($corners, 1)}) 0,
|
|
13
|
+
100% #{list.nth($corners, 1)},
|
|
14
|
+
100% calc(100% - #{list.nth($corners, 1)}),
|
|
15
|
+
calc(100% - #{list.nth($corners, 1)}) 100%,
|
|
16
|
+
#{list.nth($corners, 1)} 100%,
|
|
17
|
+
0 calc(100% - #{list.nth($corners, 1)})
|
|
15
18
|
);
|
|
16
|
-
} @else if length($corners) == 4 {
|
|
17
|
-
$corners:
|
|
19
|
+
} @else if list.length($corners) == 4 {
|
|
20
|
+
$corners: validateScissors($corners);
|
|
18
21
|
clip-path: polygon(
|
|
19
|
-
0 #{nth($corners, 1)},
|
|
20
|
-
#{nth($corners, 1)} 0,
|
|
21
|
-
calc(100% - #{nth($corners, 2)}) 0,
|
|
22
|
-
100% #{nth($corners, 2)},
|
|
23
|
-
100% calc(100% - #{nth($corners, 3)}),
|
|
24
|
-
calc(100% - #{nth($corners, 3)}) 100%,
|
|
25
|
-
#{nth($corners, 4)} 100%,
|
|
26
|
-
0 calc(100% - #{nth($corners, 4)})
|
|
22
|
+
0 #{list.nth($corners, 1)},
|
|
23
|
+
#{list.nth($corners, 1)} 0,
|
|
24
|
+
calc(100% - #{list.nth($corners, 2)}) 0,
|
|
25
|
+
100% #{list.nth($corners, 2)},
|
|
26
|
+
100% calc(100% - #{list.nth($corners, 3)}),
|
|
27
|
+
calc(100% - #{list.nth($corners, 3)}) 100%,
|
|
28
|
+
#{list.nth($corners, 4)} 100%,
|
|
29
|
+
0 calc(100% - #{list.nth($corners, 4)})
|
|
27
30
|
);
|
|
28
31
|
} @else {
|
|
29
|
-
@error "`scissors` takes either 1 corner size or 4; you passed #{length($corners)}. Pass one length to cut every corner equally, or four lengths in top-left, top-right, bottom-right, bottom-left order.";
|
|
32
|
+
@error "`scissors` takes either 1 corner size or 4; you passed #{list.length($corners)}. Pass one length to cut every corner equally, or four lengths in top-left, top-right, bottom-right, bottom-left order.";
|
|
30
33
|
}
|
|
31
34
|
}
|
|
@@ -1,18 +1,22 @@
|
|
|
1
1
|
@charset "UTF-8";
|
|
2
2
|
|
|
3
|
+
@use "sass:map";
|
|
4
|
+
@use "../maps/map-for-smartphones" as *;
|
|
5
|
+
@use "../utilities/map-deep-get" as *;
|
|
6
|
+
|
|
3
7
|
@mixin smartphone($device, $orientation: null) {
|
|
4
|
-
@if map
|
|
8
|
+
@if map.has-key($map-for-smartphones, $device) {
|
|
5
9
|
@if $orientation == portrait or $orientation == null {
|
|
6
10
|
@media only screen
|
|
7
|
-
and (device-width:
|
|
8
|
-
and (device-height:
|
|
11
|
+
and (device-width: mapDeepGet($map-for-smartphones, $device, 'width'))
|
|
12
|
+
and (device-height: mapDeepGet($map-for-smartphones, $device, 'height'))
|
|
9
13
|
and (orientation: portrait) {
|
|
10
14
|
@content;
|
|
11
15
|
}
|
|
12
16
|
} @else if $orientation == landscape {
|
|
13
17
|
@media only screen
|
|
14
|
-
and (device-width:
|
|
15
|
-
and (device-height:
|
|
18
|
+
and (device-width: mapDeepGet($map-for-smartphones, $device, 'height'))
|
|
19
|
+
and (device-height: mapDeepGet($map-for-smartphones, $device, 'width'))
|
|
16
20
|
and (orientation: landscape) {
|
|
17
21
|
@content;
|
|
18
22
|
}
|
|
@@ -20,6 +24,6 @@
|
|
|
20
24
|
@error "`#{$orientation}` is not a valid $orientation for `smartphone`. Pass `portrait`, `landscape`, or no orientation at all.";
|
|
21
25
|
}
|
|
22
26
|
} @else {
|
|
23
|
-
@error "`#{$device}` is not a device known to `smartphone`. Pass one of: #{map
|
|
27
|
+
@error "`#{$device}` is not a device known to `smartphone`. Pass one of: #{map.keys($map-for-smartphones)}.";
|
|
24
28
|
}
|
|
25
29
|
}
|