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,16 +1,20 @@
|
|
|
1
1
|
@charset "UTF-8";
|
|
2
2
|
|
|
3
|
+
@use "sass:math";
|
|
4
|
+
@use "sass:meta";
|
|
5
|
+
@use "../utilities/clear-unit" as *;
|
|
6
|
+
|
|
3
7
|
// This function checks if the argument has a px unit. If not, it adds a px unit to the end of the argument.
|
|
4
8
|
|
|
5
|
-
@function
|
|
6
|
-
@if type-of($value) != "number" {
|
|
7
|
-
@error "`#{$value}` is not a valid $value for `
|
|
9
|
+
@function pixelify($value) {
|
|
10
|
+
@if meta.type-of($value) != "number" {
|
|
11
|
+
@error "`#{$value}` is not a valid $value for `pixelify`. Pass a number, with or without a unit.";
|
|
8
12
|
}
|
|
9
|
-
@if unit($value) == "px" {
|
|
13
|
+
@if math.unit($value) == "px" {
|
|
10
14
|
@return $value;
|
|
11
|
-
} @else if unit($value) != "px" {
|
|
12
|
-
@return
|
|
13
|
-
} @else if unitless($value) == true {
|
|
15
|
+
} @else if math.unit($value) != "px" {
|
|
16
|
+
@return clearUnit($value) * 1px;
|
|
17
|
+
} @else if math.is-unitless($value) == true {
|
|
14
18
|
@return $value * 1px;
|
|
15
19
|
}
|
|
16
20
|
}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
@charset "UTF-8";
|
|
2
2
|
|
|
3
|
-
@
|
|
3
|
+
@use "sass:list";
|
|
4
|
+
|
|
5
|
+
@function pseudoSelector($elements, $pseudo: null) {
|
|
4
6
|
$list: ();
|
|
5
7
|
@each $element in $elements {
|
|
6
8
|
$element: if($pseudo, $element + ":" + $pseudo, $element);
|
|
7
|
-
$list: append($list, $element, comma);
|
|
9
|
+
$list: list.append($list, $element, comma);
|
|
8
10
|
}
|
|
9
11
|
@return $list;
|
|
10
12
|
}
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
@charset "UTF-8";
|
|
2
2
|
|
|
3
|
-
@
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
@return nth($value, 1) nth($value,
|
|
8
|
-
} @else if length($value) ==
|
|
9
|
-
@return nth($value, 1) nth($value, 2) nth($value,
|
|
10
|
-
} @else if length($value) ==
|
|
11
|
-
@return nth($value, 1) nth($value, 2) nth($value, 3) nth($value,
|
|
12
|
-
} @else if length($value)
|
|
13
|
-
@
|
|
3
|
+
@use "sass:list";
|
|
4
|
+
|
|
5
|
+
@function shorthandProperty($value) {
|
|
6
|
+
@if list.length($value) == 1 {
|
|
7
|
+
@return list.nth($value, 1) list.nth($value, 1) list.nth($value, 1) list.nth($value, 1);
|
|
8
|
+
} @else if list.length($value) == 2 {
|
|
9
|
+
@return list.nth($value, 1) list.nth($value, 2) list.nth($value, 1) list.nth($value, 2);
|
|
10
|
+
} @else if list.length($value) == 3 {
|
|
11
|
+
@return list.nth($value, 1) list.nth($value, 2) list.nth($value, 3) list.nth($value, 2);
|
|
12
|
+
} @else if list.length($value) == 4 {
|
|
13
|
+
@return list.nth($value, 1) list.nth($value, 2) list.nth($value, 3) list.nth($value, 4);
|
|
14
|
+
} @else if list.length($value) > 4 {
|
|
15
|
+
@error "You've passed #{list.length($value)} arguments. Please do not pass more than 4.";
|
|
14
16
|
}
|
|
15
17
|
}
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
@charset "UTF-8";
|
|
2
2
|
|
|
3
|
-
@
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
@use "sass:list";
|
|
4
|
+
@use "sass:map";
|
|
5
|
+
@use "../maps/map-for-breakpoints" as *;
|
|
6
|
+
|
|
7
|
+
@function validateBreakpoint($value) {
|
|
8
|
+
@for $i from 1 through list.length($value) {
|
|
9
|
+
@if map.has-key($map-for-breakpoints, $value) {
|
|
10
|
+
@return map.get($map-for-breakpoints, list.nth($value, $i));
|
|
7
11
|
} @else {
|
|
8
|
-
@return nth($value, $i);
|
|
12
|
+
@return list.nth($value, $i);
|
|
9
13
|
}
|
|
10
14
|
}
|
|
11
15
|
}
|
|
@@ -1,22 +1,27 @@
|
|
|
1
1
|
@charset "UTF-8";
|
|
2
2
|
|
|
3
|
-
@
|
|
3
|
+
@use "sass:list";
|
|
4
|
+
@use "sass:math";
|
|
5
|
+
@use "sass:meta";
|
|
6
|
+
@use "sass:string";
|
|
7
|
+
|
|
8
|
+
@function validateLength($value) {
|
|
4
9
|
$keywords: ("auto", "inherit", "initial", "unset", "revert", 0);
|
|
5
10
|
|
|
6
|
-
@if index($keywords, $value) {
|
|
11
|
+
@if list.index($keywords, $value) {
|
|
7
12
|
@return $value;
|
|
8
13
|
}
|
|
9
|
-
@if type-of($value) == "number" and not unitless($value) {
|
|
14
|
+
@if meta.type-of($value) == "number" and not math.is-unitless($value) {
|
|
10
15
|
@return $value;
|
|
11
16
|
}
|
|
12
17
|
// calc(), clamp(), min() and max() arrive as Sass calculations; var() and
|
|
13
18
|
// env() arrive as unquoted strings holding a parenthesis. Both are valid
|
|
14
19
|
// lengths, and warning about them means warning about correct modern CSS,
|
|
15
20
|
// which this function used to do.
|
|
16
|
-
@if type-of($value) == "calculation" {
|
|
21
|
+
@if meta.type-of($value) == "calculation" {
|
|
17
22
|
@return $value;
|
|
18
23
|
}
|
|
19
|
-
@if type-of($value) == "string" and
|
|
24
|
+
@if meta.type-of($value) == "string" and string.index(string.quote($value), "(") {
|
|
20
25
|
@return $value;
|
|
21
26
|
}
|
|
22
27
|
|
|
@@ -1,42 +1,54 @@
|
|
|
1
1
|
@charset "UTF-8";
|
|
2
2
|
|
|
3
|
-
@
|
|
3
|
+
@use "sass:list";
|
|
4
|
+
@use "sass:math";
|
|
5
|
+
@use "sass:meta";
|
|
6
|
+
@use "sass:string";
|
|
7
|
+
@use "../utilities/convert-to-number" as *;
|
|
8
|
+
|
|
9
|
+
// Returns a value for the CSS aspect-ratio property.
|
|
10
|
+
//
|
|
11
|
+
// Before 2.0.0 this returned the padding-top percentage the old ratio hack
|
|
12
|
+
// needed -- 56.25% for 16/9. aspect-ratio is Baseline Widely Available, so the
|
|
13
|
+
// hack is gone and this returns the ratio itself: `16 / 9`.
|
|
14
|
+
@function validateRatio($ratio) {
|
|
4
15
|
// No argument at all keeps the 16/9 default.
|
|
5
16
|
@if $ratio == null {
|
|
6
|
-
@return
|
|
17
|
+
@return list.slash(16, 9);
|
|
7
18
|
}
|
|
8
19
|
|
|
9
|
-
@if type-of($ratio) == "number" {
|
|
10
|
-
@if not unitless($ratio) {
|
|
20
|
+
@if meta.type-of($ratio) == "number" {
|
|
21
|
+
@if not math.is-unitless($ratio) {
|
|
11
22
|
@error "`#{$ratio}` is not a valid ratio. A numeric ratio must be unitless, like `1.77`.";
|
|
12
23
|
}
|
|
13
24
|
@if $ratio <= 0 {
|
|
14
25
|
@error "`#{$ratio}` is not a valid ratio. A numeric ratio must be greater than zero.";
|
|
15
26
|
}
|
|
16
|
-
|
|
27
|
+
// aspect-ratio takes a bare number, where 1.77 means 1.77 / 1.
|
|
28
|
+
@return $ratio;
|
|
17
29
|
}
|
|
18
30
|
|
|
19
|
-
@if type-of($ratio) == "string" {
|
|
31
|
+
@if meta.type-of($ratio) == "string" {
|
|
20
32
|
$separator: null;
|
|
21
|
-
@if
|
|
22
|
-
$separator:
|
|
23
|
-
} @else if
|
|
24
|
-
$separator:
|
|
33
|
+
@if string.index($ratio, "/") {
|
|
34
|
+
$separator: string.index($ratio, "/");
|
|
35
|
+
} @else if string.index($ratio, ":") {
|
|
36
|
+
$separator: string.index($ratio, ":");
|
|
25
37
|
} @else {
|
|
26
38
|
@error "`#{$ratio}` is not a valid ratio. A string ratio must separate width and height with `/` or `:`, like `\"16/9\"` or `\"16:9\"`.";
|
|
27
39
|
}
|
|
28
40
|
|
|
29
|
-
$width:
|
|
30
|
-
$height:
|
|
41
|
+
$width: convertToNumber(string.slice($ratio, 1, $separator - 1));
|
|
42
|
+
$height: convertToNumber(string.slice($ratio, $separator + 1));
|
|
31
43
|
|
|
32
44
|
@if $width == 0 {
|
|
33
45
|
@error "`#{$ratio}` is not a valid ratio. The width must be greater than zero.";
|
|
34
46
|
}
|
|
35
|
-
@return
|
|
47
|
+
@return list.slash($width, $height);
|
|
36
48
|
}
|
|
37
49
|
|
|
38
50
|
// Anything else -- most commonly a list, which is what `16/9` becomes once
|
|
39
51
|
// Dart Sass 2.0.0 removes slash division. Without this the mixin would emit
|
|
40
|
-
// no
|
|
41
|
-
@error "`#{$ratio}` is not a valid ratio. Pass a string like `\"16/9\"` or `\"16:9\"`, a unitless number like `1.77`, or no argument at all for the 16/9 default. You passed a #{type-of($ratio)}.";
|
|
52
|
+
// no aspect-ratio at all and silently produce a box with no ratio.
|
|
53
|
+
@error "`#{$ratio}` is not a valid ratio. Pass a string like `\"16/9\"` or `\"16:9\"`, a unitless number like `1.77`, or no argument at all for the 16/9 default. You passed a #{meta.type-of($ratio)}.";
|
|
42
54
|
}
|
|
@@ -1,21 +1,26 @@
|
|
|
1
1
|
@charset "UTF-8";
|
|
2
2
|
|
|
3
|
-
@
|
|
3
|
+
@use "sass:list";
|
|
4
|
+
@use "sass:math";
|
|
5
|
+
@use "sass:meta";
|
|
6
|
+
@use "../utilities/pixelify" as *;
|
|
7
|
+
|
|
8
|
+
@function validateScissors($value) {
|
|
4
9
|
$list: ();
|
|
5
|
-
@for $i from 1 through length($value) {
|
|
6
|
-
$item: nth($value, $i);
|
|
7
|
-
// unitless() below throws on anything that is not a number, and its message
|
|
10
|
+
@for $i from 1 through list.length($value) {
|
|
11
|
+
$item: list.nth($value, $i);
|
|
12
|
+
// math.is-unitless() below throws on anything that is not a number, and its message
|
|
8
13
|
// names its own parameter rather than the corner that was wrong.
|
|
9
|
-
@if $item != null and type-of($item) != "number" {
|
|
14
|
+
@if $item != null and meta.type-of($item) != "number" {
|
|
10
15
|
@error "`#{$item}` is not a valid corner size. Pass a length such as `12px`, or a unitless number which is treated as pixels.";
|
|
11
16
|
}
|
|
12
|
-
@if nth($value, $i) == null {
|
|
13
|
-
$list: append($list, 0px, comma);
|
|
14
|
-
} @else if unitless(nth($value, $i)) {
|
|
15
|
-
$pixelified:
|
|
16
|
-
$list: append($list, $pixelified, comma);
|
|
17
|
+
@if list.nth($value, $i) == null {
|
|
18
|
+
$list: list.append($list, 0px, comma);
|
|
19
|
+
} @else if math.is-unitless(list.nth($value, $i)) {
|
|
20
|
+
$pixelified: pixelify(list.nth($value, $i));
|
|
21
|
+
$list: list.append($list, $pixelified, comma);
|
|
17
22
|
} @else {
|
|
18
|
-
$list: append($list, nth($value, $i), comma);
|
|
23
|
+
$list: list.append($list, list.nth($value, $i), comma);
|
|
19
24
|
}
|
|
20
25
|
}
|
|
21
26
|
@return $list;
|