gerillass 1.5.0 → 1.6.1

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.
Files changed (39) hide show
  1. package/README.md +2 -2
  2. package/SKILL.md +198 -0
  3. package/gerillass.json +1904 -0
  4. package/package.json +2 -1
  5. package/scss/_gerillass-prefix.scss +90 -15
  6. package/scss/library/_after.scss +3 -1
  7. package/scss/library/_all-buttons.scss +1 -1
  8. package/scss/library/_all-text-inputs.scss +1 -1
  9. package/scss/library/_antialias.scss +4 -0
  10. package/scss/library/_background-dots.scss +6 -0
  11. package/scss/library/_background-image.scss +2 -2
  12. package/scss/library/_background-stripes.scss +6 -0
  13. package/scss/library/_before.scss +3 -1
  14. package/scss/library/_border-box.scss +4 -0
  15. package/scss/library/_border-radius.scss +3 -1
  16. package/scss/library/_breakpointer.scss +3 -0
  17. package/scss/library/_center.scss +3 -0
  18. package/scss/library/_columnizer.scss +5 -0
  19. package/scss/library/_escape-to-parent.scss +3 -0
  20. package/scss/library/_except.scss +2 -0
  21. package/scss/library/_font-face.scss +4 -0
  22. package/scss/library/_linear-gradient.scss +2 -2
  23. package/scss/library/_only.scss +2 -0
  24. package/scss/library/_radial-gradient.scss +6 -0
  25. package/scss/library/_remove.scss +1 -1
  26. package/scss/library/_scissors.scss +2 -0
  27. package/scss/library/_smartphone.scss +3 -1
  28. package/scss/library/_sprite.scss +4 -0
  29. package/scss/library/_tablet.scss +3 -1
  30. package/scss/library/_text-gradient.scss +2 -2
  31. package/scss/library/_text-selection.scss +4 -0
  32. package/scss/library/_text-shadow.scss +7 -0
  33. package/scss/library/_triangle.scss +1 -1
  34. package/scss/utilities/_clear-whitespace.scss +3 -0
  35. package/scss/utilities/_convert-to-number.scss +4 -0
  36. package/scss/utilities/_null.scss +3 -0
  37. package/scss/utilities/_pixelify.scss +3 -0
  38. package/scss/utilities/_validate-length.scss +17 -5
  39. package/scss/utilities/_validate-scissors.scss +6 -0
@@ -14,5 +14,9 @@
14
14
  *::selection {
15
15
  @content;
16
16
  }
17
+ } @else if not & and $value == "only" {
18
+ @error "`only` has no meaning at the root of a stylesheet, because there is no selector to limit the effect to. Call `text-selection(\"only\")` inside a selector, or pass no argument at all.";
19
+ } @else {
20
+ @error "`#{$value}` is not a valid argument for `text-selection`. Pass `\"only\"` inside a selector to affect just that element, or pass no argument at all.";
17
21
  }
18
22
  }
@@ -7,6 +7,13 @@
7
7
  // Takes each items come from $params.
8
8
  $item: nth($params, $i);
9
9
 
10
+ // Each group must carry at least a direction, a colour and a size. Without
11
+ // this the nth() calls below fail with "Invalid index", which says nothing
12
+ // about what the mixin wanted.
13
+ @if length($item) < 3 {
14
+ @error "`#{$item}` is not a valid shadow for `text-shadow`. Each group needs a direction, a colour and a size, such as `bottom-right red 5px`. An optional blur and a fill flag may follow.";
15
+ }
16
+
10
17
  // The first value comes from the $item is direction.
11
18
  // This will be used in the @if, @else statements with $size to control the offset of the shadows.
12
19
  $direction: nth($item, 1);
@@ -36,6 +36,6 @@
36
36
  @content;
37
37
  }
38
38
  } @else {
39
- @error "The argument for direction must be one of the followings: #{quote($list-of-directions)}";
39
+ @error "The argument for direction must be one of the followings: #{$list-of-directions}";
40
40
  }
41
41
  }
@@ -1,6 +1,9 @@
1
1
  @charset "UTF-8";
2
2
 
3
3
  @function __clearWhitespace($string) {
4
+ @if type-of($string) != "string" {
5
+ @error "`#{$string}` is not a valid $string for `__clearWhitespace`. Pass a string.";
6
+ }
4
7
  @while (str-index($string, " ") != null) {
5
8
  $index: str-index($string, " ");
6
9
  $string: "#{str-slice($string, 0, $index - 1)}#{str-slice($string, $index + 1)}";
@@ -2,6 +2,10 @@
2
2
 
3
3
  @function __convertToNumber($value) {
4
4
 
5
+ @if type-of($value) != "string" {
6
+ @error "`#{$value}` is not a valid $value for `__convertToNumber`. Pass a string made only of digits, such as `\"42\"`.";
7
+ }
8
+
5
9
  $string-numerals: "0" "1" "2" "3" "4" "5" "6" "7" "8" "9";
6
10
  $calc: 0;
7
11
 
@@ -1,6 +1,9 @@
1
1
  @charset "UTF-8";
2
2
 
3
3
  @function __null($value, $seperation: comma, $skip: false) {
4
+ @if not index("comma" "space" "slash", $seperation) {
5
+ @error "`#{$seperation}` is not a valid $seperation for `__null`. Pass `comma`, `space` or `slash`.";
6
+ }
4
7
  $list: ();
5
8
  @for $i from 1 through length($value) {
6
9
  @if nth($value, $i) == null {
@@ -3,6 +3,9 @@
3
3
  // This function checks if the argument has a px unit. If not, it adds a px unit to the end of the argument.
4
4
 
5
5
  @function __pixelify($value) {
6
+ @if type-of($value) != "number" {
7
+ @error "`#{$value}` is not a valid $value for `__pixelify`. Pass a number, with or without a unit.";
8
+ }
6
9
  @if unit($value) == "px" {
7
10
  @return $value;
8
11
  } @else if unit($value) != "px" {
@@ -1,13 +1,25 @@
1
1
  @charset "UTF-8";
2
2
 
3
3
  @function __validateLength($value) {
4
- $list: ("auto", "inherit", "initial", 0);
5
- @if index($list, $value) {
4
+ $keywords: ("auto", "inherit", "initial", "unset", "revert", 0);
5
+
6
+ @if index($keywords, $value) {
7
+ @return $value;
8
+ }
9
+ @if type-of($value) == "number" and not unitless($value) {
6
10
  @return $value;
7
- } @else if type-of($value) == "number" and not unitless($value) {
11
+ }
12
+ // calc(), clamp(), min() and max() arrive as Sass calculations; var() and
13
+ // env() arrive as unquoted strings holding a parenthesis. Both are valid
14
+ // lengths, and warning about them means warning about correct modern CSS,
15
+ // which this function used to do.
16
+ @if type-of($value) == "calculation" {
8
17
  @return $value;
9
- } @else {
10
- @warn "Please pass some values with unit like `#{$value}px`, `#{$value}em`, or `#{$value}%` etc. or pass one of the following arguments: `auto`, ìnherit`, ìnitial` or `0`.";
18
+ }
19
+ @if type-of($value) == "string" and str-index(quote($value), "(") {
11
20
  @return $value;
12
21
  }
22
+
23
+ @warn "`#{$value}` does not look like a length. Pass a number with a unit such as `20px`, a CSS function such as `var(--gap)` or `calc(1rem + 2px)`, or one of: auto, inherit, initial, unset, revert, 0.";
24
+ @return $value;
13
25
  }
@@ -3,6 +3,12 @@
3
3
  @function __validateScissors($value) {
4
4
  $list: ();
5
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
8
+ // names its own parameter rather than the corner that was wrong.
9
+ @if $item != null and type-of($item) != "number" {
10
+ @error "`#{$item}` is not a valid corner size. Pass a length such as `12px`, or a unitless number which is treated as pixels.";
11
+ }
6
12
  @if nth($value, $i) == null {
7
13
  $list: append($list, 0px, comma);
8
14
  } @else if unitless(nth($value, $i)) {