gerillass 0.0.6 → 3.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.
Files changed (121) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE.md +13 -0
  3. data/README.md +328 -0
  4. data/SKILL.md +282 -0
  5. data/gerillass.json +2713 -0
  6. data/lib/gerillass/engine.rb +55 -0
  7. data/lib/gerillass/jekyll.rb +13 -0
  8. data/lib/gerillass.rb +26 -0
  9. data/scss/_gerillass.scss +15 -0
  10. data/scss/internal/_color-problem.scss +99 -0
  11. data/scss/internal/_color-stops-problem.scss +94 -0
  12. data/scss/internal/_condition-width.scss +22 -0
  13. data/scss/internal/_custom-property-in.scss +25 -0
  14. data/scss/internal/_gradient.scss +425 -0
  15. data/scss/internal/_image-value.scss +68 -0
  16. data/scss/internal/_is-condition-value.scss +94 -0
  17. data/scss/internal/_is-css-function.scss +21 -0
  18. data/scss/internal/_is-size.scss +22 -0
  19. data/scss/internal/_keyword-value.scss +76 -0
  20. data/scss/internal/_length-problem.scss +127 -0
  21. data/scss/internal/_sibling-index.scss +51 -0
  22. data/scss/internal/_words.scss +35 -0
  23. data/scss/library/_adaptive.scss +31 -0
  24. data/scss/library/_after.scss +28 -0
  25. data/scss/library/_all-buttons.scss +21 -0
  26. data/scss/library/_all-text-inputs.scss +21 -0
  27. data/{core → scss}/library/_antialias.scss +5 -1
  28. data/scss/library/_aspect-ratio.scss +27 -0
  29. data/scss/library/_background-dots.scss +104 -0
  30. data/scss/library/_background-image.scss +89 -0
  31. data/scss/library/_background-stripes.scss +88 -0
  32. data/scss/library/_before.scss +28 -0
  33. data/scss/library/_border-box.scss +30 -0
  34. data/scss/library/_border-radius.scss +164 -0
  35. data/scss/library/_brand-logo.scss +33 -0
  36. data/scss/library/_breakpoint.scss +96 -0
  37. data/scss/library/_breakpointer.scss +40 -0
  38. data/scss/library/_center.scss +19 -0
  39. data/scss/library/_circle.scss +15 -0
  40. data/{core → scss}/library/_clearfix.scss +1 -1
  41. data/scss/library/_columnizer.scss +125 -0
  42. data/scss/library/_container-query.scss +119 -0
  43. data/scss/library/_container.scss +72 -0
  44. data/scss/library/_counter.scss +59 -0
  45. data/scss/library/_ellipsis.scss +87 -0
  46. data/scss/library/_escape-to-parent.scss +12 -0
  47. data/scss/library/_except.scss +71 -0
  48. data/scss/library/_focus-ring.scss +63 -0
  49. data/scss/library/_font-face.scss +240 -0
  50. data/scss/library/_gradient.scss +31 -0
  51. data/scss/library/_hide.scss +25 -0
  52. data/scss/library/_index.scss +57 -0
  53. data/scss/library/_line-clamp.scss +38 -0
  54. data/scss/library/_loadify.scss +62 -0
  55. data/scss/library/_motion-safe.scss +28 -0
  56. data/scss/library/_only.scss +73 -0
  57. data/scss/library/_placeholder-shown.scss +7 -0
  58. data/scss/library/_placeholder.scss +19 -0
  59. data/scss/library/_position.scss +72 -0
  60. data/scss/library/_remove.scss +40 -0
  61. data/scss/library/_reset-css.scss +57 -0
  62. data/scss/library/_reset-figure.scss +10 -0
  63. data/scss/library/_resizable.scss +34 -0
  64. data/scss/library/_responsive-image.scss +6 -0
  65. data/scss/library/_scissors.scss +34 -0
  66. data/scss/library/_screen-agent.scss +34 -0
  67. data/scss/library/_sizer.scss +15 -0
  68. data/scss/library/_smartphone.scss +29 -0
  69. data/scss/library/_sprite.scss +100 -0
  70. data/scss/library/_stretched-link.scss +21 -0
  71. data/scss/library/_tablet.scss +29 -0
  72. data/scss/library/_text-gradient.scss +48 -0
  73. data/scss/library/_text-image.scss +15 -0
  74. data/scss/library/_text-selection.scss +22 -0
  75. data/scss/library/_text-shadow.scss +145 -0
  76. data/scss/library/_text-stroke.scss +43 -0
  77. data/scss/library/_tokens.scss +111 -0
  78. data/scss/library/_triangle.scss +115 -0
  79. data/scss/lists/_index.scss +8 -0
  80. data/scss/lists/_list-of-anchor-pseudo-classes.scss +9 -0
  81. data/scss/lists/_list-of-buttons.scss +8 -0
  82. data/scss/lists/_list-of-counter-styles.scss +59 -0
  83. data/scss/lists/_list-of-directions.scss +12 -0
  84. data/scss/lists/_list-of-length-units.scss +23 -0
  85. data/scss/lists/_list-of-text-inputs.scss +20 -0
  86. data/scss/maps/_index.scss +8 -0
  87. data/scss/maps/_map-for-breakpoints.scss +9 -0
  88. data/scss/maps/_map-for-directions.scss +12 -0
  89. data/scss/maps/_map-for-font-formats.scss +9 -0
  90. data/scss/maps/_map-for-positions.scss +13 -0
  91. data/scss/maps/_map-for-smartphones.scss +72 -0
  92. data/scss/maps/_map-for-tablets.scss +32 -0
  93. data/scss/utilities/_clear-unit.scss +11 -0
  94. data/scss/utilities/_clear-whitespace.scss +15 -0
  95. data/scss/utilities/_convert-to-em.scss +16 -0
  96. data/scss/utilities/_convert-to-number.scss +45 -0
  97. data/scss/utilities/_fill-nulls.scss +18 -0
  98. data/scss/utilities/_fluid.scss +76 -0
  99. data/scss/utilities/_font-sizer.scss +19 -0
  100. data/scss/utilities/_font-source.scss +23 -0
  101. data/scss/utilities/_gradient-value.scss +24 -0
  102. data/scss/utilities/_index.scss +26 -0
  103. data/scss/utilities/_is-color.scss +16 -0
  104. data/scss/utilities/_is-gutter.scss +24 -0
  105. data/scss/utilities/_is-number.scss +11 -0
  106. data/scss/utilities/_is-time.scss +14 -0
  107. data/scss/utilities/_map-deep-get.scss +10 -0
  108. data/scss/utilities/_pixelify.scss +20 -0
  109. data/scss/utilities/_pseudo-selector.scss +12 -0
  110. data/scss/utilities/_remify.scss +16 -0
  111. data/scss/utilities/_shade.scss +10 -0
  112. data/scss/utilities/_shorthand-property.scss +17 -0
  113. data/scss/utilities/_tint.scss +10 -0
  114. data/scss/utilities/_validate-breakpoint.scss +41 -0
  115. data/scss/utilities/_validate-length.scss +37 -0
  116. data/scss/utilities/_validate-ratio.scss +77 -0
  117. data/scss/utilities/_validate-scissors.scss +34 -0
  118. metadata +131 -46
  119. data/core/_gerillass.scss +0 -4
  120. data/core/library/_before.scss +0 -18
  121. data/core/library/_border-box.scss +0 -26
@@ -0,0 +1,76 @@
1
+ @charset "UTF-8";
2
+
3
+ @use "sass:list";
4
+ @use "sass:meta";
5
+ @use "sass:string";
6
+ @use "words" as *;
7
+
8
+ // Shared by the mixins and not public API; see _is-css-function.scss.
9
+
10
+ $-css-wide: "inherit" "initial" "unset" "revert" "revert-layer";
11
+
12
+ // Returns what is wrong with $value as a keyword value, or null when it is fine.
13
+ // It checks the kind of each word, not whether the words make sense together;
14
+ // a mixin whose property has a grammar, such as display, checks that itself.
15
+ //
16
+ // - null is fine: the declaration is left out, as it always was.
17
+ // - Any word holding a parenthesis makes the whole value fine when $functions is
18
+ // true. var(), env() and calc() are resolved by the browser, and a value such
19
+ // as `var(--x) auto` cannot be judged here. In a @font-face descriptor, which
20
+ // drops var(), the caller passes false.
21
+ // - Up to $max-words words, each one of $keywords in any case; `STICKY` and
22
+ // `BOTH` were kept in Chrome 152.
23
+ // - A CSS-wide keyword only on its own: `overflow: inherit auto` was dropped.
24
+ // - A vendor-prefixed word when $vendor is true. Chrome drops `-webkit-sticky`
25
+ // and `-moz-box`, but other engines use them, so refusing one could break a
26
+ // stylesheet written for Safari.
27
+ @function keywordProblem($value, $keywords, $max-words: 1, $functions: true, $vendor: false) {
28
+ @if $value == null {
29
+ @return null;
30
+ }
31
+ @if meta.type-of($value) == "list" and list.separator($value) == "comma" {
32
+ @return "it takes a space-separated value, not a comma-separated list";
33
+ }
34
+ $words: wordsOf($value);
35
+ @if list.length($words) == 0 {
36
+ @return "it is empty";
37
+ }
38
+ @each $word in $words {
39
+ @if meta.type-of($word) == "string" and string.index($word, "(") {
40
+ @if $functions {
41
+ @return null;
42
+ }
43
+ @return "a function cannot supply it here";
44
+ }
45
+ }
46
+ @if list.length($words) > $max-words {
47
+ @if $max-words == 1 {
48
+ @return "it takes one keyword, and got #{list.length($words)}";
49
+ }
50
+ @return "it takes at most #{$max-words} keywords, and got #{list.length($words)}";
51
+ }
52
+ $expected: list.join($keywords, (), $separator: comma);
53
+ @each $word in $words {
54
+ @if meta.type-of($word) != "string" {
55
+ @if list.length($words) == 1 {
56
+ @return "it takes a keyword, one of: #{$expected}";
57
+ }
58
+ @return "`#{meta.inspect($word)}` is not a keyword; pass words from: #{$expected}";
59
+ }
60
+ $lower: string.to-lower-case(string.unquote($word));
61
+ @if list.index($-css-wide, $lower) {
62
+ @if list.length($words) > 1 {
63
+ @return "`#{$lower}` only works as the whole value";
64
+ }
65
+ } @else if not list.index($keywords, $lower) {
66
+ $prefixed: string.index($lower, "-webkit-") == 1 or string.index($lower, "-moz-") == 1 or string.index($lower, "-ms-") == 1 or string.index($lower, "-o-") == 1;
67
+ @if not ($vendor and $prefixed) {
68
+ @if list.length($words) == 1 {
69
+ @return "it is not one of: #{$expected}";
70
+ }
71
+ @return "`#{$lower}` is not one of: #{$expected}";
72
+ }
73
+ }
74
+ }
75
+ @return null;
76
+ }
@@ -0,0 +1,127 @@
1
+ @charset "UTF-8";
2
+
3
+ @use "sass:list";
4
+ @use "sass:math";
5
+ @use "sass:meta";
6
+ @use "sass:string";
7
+ @use "is-condition-value" as *;
8
+
9
+ // Shared by the mixins and not public API; see _is-css-function.scss.
10
+
11
+ // Maths functions a browser resolves to a length, and the substitutions whose
12
+ // value only the browser knows. Sass reduces most maths on plain numbers before
13
+ // they get here (`round(10.5px, 1px)` arrives as 11px), so these are the forms
14
+ // it leaves as text.
15
+ $-functions: "var" "env" "attr" "calc" "clamp" "min" "max" "round" "abs" "sign" "mod" "rem" "hypot" "sqrt" "pow" "exp" "log";
16
+ $-css-wide: "inherit" "initial" "unset" "revert" "revert-layer";
17
+
18
+ // Returns what is wrong with $value as one length for a property, or null when
19
+ // a browser keeps it. Each caller passes what its property takes, measured in
20
+ // Chrome 152 (see todos/silent-values-plan.md, S7):
21
+ //
22
+ // - $percent: whether a percentage works (width yes, outline-width no);
23
+ // - $negative: whether a negative length works (outline-offset yes, width no);
24
+ // - $keywords: the words the property takes, such as auto or thin;
25
+ // - $functions: sizing functions beyond maths, such as anchor-size;
26
+ // - $css-wide: whether a CSS-wide keyword works, which is only as a whole
27
+ // declaration;
28
+ // - $quoted: whether a quoted length works, which is only where the mixin
29
+ // interpolates it; written raw, `width: "10px"` is dropped.
30
+ //
31
+ // A unitless 0 is accepted; a caller whose output breaks on it handles it.
32
+ // A calculation is taken on trust, since Sass keeps it only when it cannot
33
+ // reduce it.
34
+ @function lengthProblem($value, $percent: true, $negative: true, $keywords: (), $functions: (), $css-wide: false, $quoted: false) {
35
+ @if meta.type-of($value) == "calculation" {
36
+ @return null;
37
+ }
38
+ @if meta.type-of($value) == "list" and list.length($value) > 1 {
39
+ @return "it is several values where one length is meant";
40
+ }
41
+ @if meta.type-of($value) == "number" {
42
+ @if math.is-unitless($value) {
43
+ @if $value == 0 {
44
+ @return null;
45
+ }
46
+ @return "a unitless number is not a length; add a unit, such as `#{$value}px`";
47
+ }
48
+ @if math.unit($value) == "%" and not $percent {
49
+ @return "a percentage does not work here";
50
+ }
51
+ @if not isConditionValue($value, "length-percentage") {
52
+ @return "`#{math.unit($value)}` is not a length unit";
53
+ }
54
+ @if not $negative and $value < 0 {
55
+ @return "a length below zero does not work here";
56
+ }
57
+ @return null;
58
+ }
59
+ @if meta.type-of($value) != "string" {
60
+ @return "it is not a length";
61
+ }
62
+ $kind: "length";
63
+ @if $percent {
64
+ $kind: "length-percentage";
65
+ }
66
+ @if string.slice(meta.inspect($value), 1, 1) == "\"" {
67
+ @if $quoted and isConditionValue($value, $kind) {
68
+ @return null;
69
+ }
70
+ @return "a length in quotes is text here; write it without quotes";
71
+ }
72
+ $lower: string.to-lower-case($value);
73
+ $open: string.index($lower, "(");
74
+ @if $open {
75
+ $name: string.slice($lower, 1, $open - 1);
76
+ @if list.index($-functions, $name) or list.index($functions, $name) {
77
+ @return null;
78
+ }
79
+ @return "`#{$name}()` does not give a length here";
80
+ }
81
+ @if string.index($lower, " ") {
82
+ @return "it is several values where one length is meant";
83
+ }
84
+ // Interpolation, such as `#{$n}px`, gives an unquoted string rather than a
85
+ // number, and it is written into the CSS as it reads, so its content decides.
86
+ @if isConditionValue($value, $kind) {
87
+ @if not $negative and string.index($lower, "-") == 1 {
88
+ @return "a length below zero does not work here";
89
+ }
90
+ @return null;
91
+ }
92
+ @if string.index($lower, "%") and isConditionValue($value, "length-percentage") {
93
+ @return "a percentage does not work here";
94
+ }
95
+ @if list.index($keywords, $lower) {
96
+ @return null;
97
+ }
98
+ @if list.index($-css-wide, $lower) {
99
+ @if $css-wide {
100
+ @return null;
101
+ }
102
+ @return "a CSS-wide keyword only works as a whole declaration, not here";
103
+ }
104
+ @if list.length($keywords) > 0 {
105
+ @return "it is not a length or one of: #{list.join($keywords, (), $separator: comma)}";
106
+ }
107
+ @return "it is not a length";
108
+ }
109
+
110
+ // lengthProblem for a width or height, and for max-width with $max. Measured in
111
+ // Chrome 152: width and height keep the intrinsic keywords, stretch,
112
+ // -webkit-fill-available, anchor-size(), calc-size() and a CSS-wide keyword;
113
+ // max-width keeps none where width keeps auto, and drops calc-size(). Both drop
114
+ // a negative length. -moz-available is Firefox's spelling of stretch; Chrome
115
+ // drops it, and it is let through like the other vendor keywords.
116
+ //
117
+ // null is accepted, since Sass leaves the declaration out, as it always has.
118
+ @function sizeProblem($value, $max: false) {
119
+ @if $value == null {
120
+ @return null;
121
+ }
122
+ $keywords: "min-content" "max-content" "fit-content" "stretch" "-webkit-fill-available" "-moz-available";
123
+ @if $max {
124
+ @return lengthProblem($value, $negative: false, $keywords: list.append($keywords, "none"), $functions: ("anchor-size",), $css-wide: true);
125
+ }
126
+ @return lengthProblem($value, $negative: false, $keywords: list.append($keywords, "auto"), $functions: "anchor-size" "calc-size", $css-wide: true);
127
+ }
@@ -0,0 +1,51 @@
1
+ @charset "UTF-8";
2
+
3
+ @use "sass:math";
4
+ @use "sass:meta";
5
+
6
+ // Shared by the mixins and not public API; see _is-css-function.scss.
7
+
8
+ // Returns what is wrong with $value as a sibling position for `only` or
9
+ // `except`, or null when it is a whole number other than 0. Measured in Chrome
10
+ // 152 on six siblings:
11
+ //
12
+ // - a number with any unit or a fraction, `:nth-of-type(10deg)`,
13
+ // `:nth-of-type(10px)`, `:nth-of-type(1.5)`, is an invalid selector, and the
14
+ // browser drops the whole rule. In a selector list that takes every other
15
+ // selector with it: `.a:nth-of-type(1), .a:nth-of-type(10deg)` was dropped.
16
+ // - `:nth-of-type(0)` is valid and matched none of the six, and
17
+ // `:not(:nth-of-type(0))` matched all six, since positions count from 1.
18
+ // - a negative number, `+3` and `99999` were kept; `only` and `except` turn a
19
+ // negative position into :nth-last-of-type.
20
+ //
21
+ // $several is true when the value is one of several arguments, where only
22
+ // positions are taken; alone, a word is a keyword or a selector.
23
+ @function siblingIndexProblem($value, $mixin, $several: false) {
24
+ @if meta.type-of($value) != "number" {
25
+ @if $several {
26
+ @return "several arguments are all positions, whole numbers such as `1` or `-2`. Pass a keyword such as `first`, or a selector such as `.foo`, on its own";
27
+ }
28
+ @return null;
29
+ }
30
+ // A multiple of n, such as `3n`, reaches here as a number whose unit is n.
31
+ // Measured in Chrome 152, :nth-of-type(3n) is valid and matched two of six
32
+ // siblings, and main compiled only(3n) to it, so it is accepted. Its
33
+ // coefficient is checked like a position: `1.5n` was dropped and `0n`
34
+ // matched nothing.
35
+ $coefficient: $value;
36
+ @if math.unit($value) == "n" {
37
+ $coefficient: math.div($value, 1n);
38
+ } @else if not math.is-unitless($value) {
39
+ @return "a position is a whole number such as `2`, or a multiple of n such as `3n`, and `:nth-of-type(#{math.abs($value)})` is an invalid selector, so the browser would drop the rule. Pass a number such as `2`, or `-2` to count from the end";
40
+ }
41
+ @if math.round($coefficient) != $coefficient {
42
+ @return "a position is a whole number, and `:nth-of-type(#{math.abs($value)})` is an invalid selector, so the browser would drop the rule. Pass a number such as `2`, or `-2` to count from the end";
43
+ }
44
+ @if $coefficient == 0 {
45
+ @if $mixin == "except" {
46
+ @return "positions count from 1, so `:not(:nth-of-type(0))` excludes nothing. Pass `1` for the first, or `-1` for the last";
47
+ }
48
+ @return "positions count from 1, so `:nth-of-type(0)` matches nothing. Pass `1` for the first, or `-1` for the last";
49
+ }
50
+ @return null;
51
+ }
@@ -0,0 +1,35 @@
1
+ @charset "UTF-8";
2
+
3
+ @use "sass:list";
4
+ @use "sass:meta";
5
+ @use "sass:string";
6
+
7
+ // Shared by the mixins and not public API; see _is-css-function.scss.
8
+
9
+ // The words of a value, as a space-separated list. A quoted string such as
10
+ // "block flow-root" is split on its spaces, the way the browser reads it once
11
+ // the quotes are gone; a space-separated list gives its items; anything else is
12
+ // one word. Empty words from repeated spaces are skipped.
13
+ @function wordsOf($value) {
14
+ @if meta.type-of($value) == "list" and list.separator($value) != "comma" {
15
+ @return $value;
16
+ }
17
+ @if meta.type-of($value) != "string" {
18
+ @return ($value,);
19
+ }
20
+ $words: ();
21
+ $rest: $value;
22
+ $at: string.index($rest, " ");
23
+ @while $at {
24
+ $word: string.slice($rest, 1, $at - 1);
25
+ @if string.length($word) > 0 {
26
+ $words: list.append($words, $word);
27
+ }
28
+ $rest: string.slice($rest, $at + 1);
29
+ $at: string.index($rest, " ");
30
+ }
31
+ @if string.length($rest) > 0 {
32
+ $words: list.append($words, $rest);
33
+ }
34
+ @return $words;
35
+ }
@@ -0,0 +1,31 @@
1
+ @charset "UTF-8";
2
+
3
+ @use "sass:map";
4
+ @use "sass:math";
5
+ @use "sass:meta";
6
+ @use "sass:string";
7
+ @use "../maps/map-for-breakpoints" as *;
8
+ @use "../internal/length-problem" as *;
9
+
10
+ @mixin adaptive($gutter: 30px) {
11
+ // The gutter is subtracted twice inside calc(), which in Chrome 152 kept a
12
+ // length, a percentage, a negative length and var(), and dropped the
13
+ // max-width for a word, a CSS-wide keyword, a unitless number and a unit that
14
+ // is not a length. A quoted length works, since it is interpolated.
15
+ $problem: lengthProblem($gutter, $functions: ("anchor-size",), $quoted: true);
16
+ @if $problem {
17
+ @error "`#{meta.inspect($gutter)}` is not a valid $gutter for `adaptive`: #{$problem}. A browser drops the max-width at every breakpoint.";
18
+ }
19
+ // A unitless 0 made `calc(576px - 0 * 2)`, a length minus a number, which was
20
+ // dropped; 0px is kept.
21
+ @if (meta.type-of($gutter) == "number" and math.is-unitless($gutter)) or (meta.type-of($gutter) == "string" and string.unquote($gutter) == string.unquote("0")) {
22
+ $gutter: 0px;
23
+ }
24
+ $actual-breakpoints: map.remove($map-for-breakpoints, "xsmall");
25
+ margin: 0 auto;
26
+ @each $item, $value in $actual-breakpoints {
27
+ @media (min-width: #{$value}) {
28
+ max-width: calc(#{$value} - (#{$gutter} * 2));
29
+ }
30
+ }
31
+ }
@@ -0,0 +1,28 @@
1
+ @charset "UTF-8";
2
+
3
+ @use "sass:meta";
4
+ @use "sass:string";
5
+ @use "../internal/is-css-function" as *;
6
+
7
+ @mixin after($content: null) {
8
+ &::after {
9
+ @if $content == null {
10
+ @content;
11
+ } @else if meta.type-of($content) != "string" {
12
+ @error "`#{$content}` is not a valid $content for `after`. Pass a string to use as the content value, a data- attribute name such as `\"data-label\"` to render it with attr(), or no argument at all and write the content yourself.";
13
+ } @else if isCssFunction($content, "var" "attr" "counter" "counters") {
14
+ // Quoting would turn the call into text: content: "var(--label)".
15
+ content: $content;
16
+ @content;
17
+ } @else {
18
+ $data: string.slice($content, 1, 5);
19
+ @if $data == "data-" {
20
+ content: attr(#{$content});
21
+ @content;
22
+ } @else {
23
+ content: "#{$content}";
24
+ @content;
25
+ }
26
+ }
27
+ }
28
+ }
@@ -0,0 +1,21 @@
1
+ @charset "UTF-8";
2
+
3
+ @use "sass:list";
4
+ @use "../lists/list-of-buttons" as *;
5
+ @use "../utilities/pseudo-selector" as *;
6
+
7
+ @mixin all-buttons($pseudo: null) {
8
+ $list: "hover", "focus", "active", "disabled";
9
+ @if not $pseudo {
10
+ #{$list-of-buttons} {
11
+ @content;
12
+ }
13
+ } @else if list.index($list, $pseudo) {
14
+ $all-buttons: pseudoSelector($list-of-buttons, $pseudo);
15
+ #{$all-buttons} {
16
+ @content;
17
+ }
18
+ } @else {
19
+ @error "The argument must be `null` or one of the followings: #{$list}.";
20
+ }
21
+ }
@@ -0,0 +1,21 @@
1
+ @charset "UTF-8";
2
+
3
+ @use "sass:list";
4
+ @use "../lists/list-of-text-inputs" as *;
5
+ @use "../utilities/pseudo-selector" as *;
6
+
7
+ @mixin all-text-inputs($pseudo: null) {
8
+ $list: "hover", "focus", "focus-visible", "active", "invalid", "user-invalid", "required", "disabled";
9
+ @if not $pseudo {
10
+ #{$list-of-text-inputs} {
11
+ @content;
12
+ }
13
+ } @else if list.index($list, $pseudo) {
14
+ $all-text-inputs: pseudoSelector($list-of-text-inputs, $pseudo);
15
+ #{$all-text-inputs} {
16
+ @content;
17
+ }
18
+ } @else {
19
+ @error "The argument must be `null` or one of the followings: #{$list}";
20
+ }
21
+ }
@@ -1,6 +1,6 @@
1
1
  @charset "UTF-8";
2
2
 
3
- @mixin gorillass-antialias($value: null) {
3
+ @mixin antialias($value: null) {
4
4
  @if not & and $value == null {
5
5
  *,
6
6
  *::before,
@@ -25,5 +25,9 @@
25
25
  -webkit-font-smoothing: antialiased;
26
26
  -moz-osx-font-smoothing: grayscale;
27
27
  }
28
+ } @else if not & and $value == "only" {
29
+ @error "`only` has no meaning at the root of a stylesheet, because there is no selector to limit the effect to. Call `antialias(\"only\")` inside a selector, or pass no argument at all.";
30
+ } @else {
31
+ @error "`#{$value}` is not a valid argument for `antialias`. Pass `\"only\"` inside a selector to affect just that element, or pass no argument at all.";
28
32
  }
29
33
  }
@@ -0,0 +1,27 @@
1
+ @charset "UTF-8";
2
+
3
+ @use "sass:list";
4
+ @use "../utilities/validate-ratio" as *;
5
+
6
+ // Holds an element to a ratio, and closes the three gaps CSS leaves open when
7
+ // you set `aspect-ratio` by hand. All three were measured in a browser:
8
+ //
9
+ // * an <img> with a ratio but no `object-fit` is stretched, not cropped;
10
+ // * an <iframe> carries a 2px default border, so `width: 100%` overflows its
11
+ // container by 4px;
12
+ // * the ratio belongs on the element itself. On a wrapper it does nothing for
13
+ // an <iframe> inside, which keeps its intrinsic 300x150.
14
+ //
15
+ // Pass `null` as $fit to leave `object-fit` alone.
16
+ @mixin aspect-ratio($ratio: null, $fit: cover) {
17
+ @if $fit and not list.index("fill" "contain" "cover" "none" "scale-down", $fit) {
18
+ @error "`#{$fit}` is not a valid $fit for `aspect-ratio`. Pass one of: fill, contain, cover, none, scale-down, or null to leave object-fit alone.";
19
+ }
20
+ display: block;
21
+ width: 100%;
22
+ aspect-ratio: validateRatio($ratio);
23
+ border: 0;
24
+ @if $fit {
25
+ object-fit: $fit;
26
+ }
27
+ }
@@ -0,0 +1,104 @@
1
+ @charset "UTF-8";
2
+
3
+ @use "sass:list";
4
+ @use "sass:meta";
5
+ @use "sass:string";
6
+ @use "../internal/is-size" as *;
7
+ @use "../internal/image-value" as *;
8
+ @use "../internal/color-problem" as *;
9
+ @use "../internal/length-problem" as *;
10
+ @use "../internal/gradient" as *;
11
+
12
+ @mixin background-dots(
13
+ $color: null,
14
+ $size: 1em,
15
+ $gutter: null,
16
+ $diagonal: true,
17
+ $image: null
18
+ ) {
19
+ // The gutter defaults to five times the size. Deriving it here rather than in
20
+ // the signature lets $size be checked first, and doing the arithmetic in
21
+ // calc() lets var() and clamp() through: Sass simplifies calc() on plain
22
+ // numbers back to a number, so a call with lengths emits the same CSS.
23
+ @if not isSize($size) {
24
+ @error "`#{meta.inspect($size)}` is not a valid $size for `background-dots`. Pass a length, or var(), env() or a calculation such as `clamp()`.";
25
+ }
26
+ @if $gutter == null {
27
+ $gutter: calc($size * 5);
28
+ }
29
+ @if not isSize($gutter) {
30
+ @error "`#{meta.inspect($gutter)}` is not a valid $gutter for `background-dots`. Pass a length, or var(), env() or a calculation such as `calc()`.";
31
+ }
32
+ // isSize takes any number, since it only guards the arithmetic. The size is a
33
+ // colour stop's position and the gutter a background-size, which in Chrome
34
+ // 152 kept a percentage and dropped a negative length, a unitless number
35
+ // other than 0 and a unit that is not a length, so no dots were drawn.
36
+ @each $name, $value in ("$size": $size, "$gutter": $gutter) {
37
+ $problem: lengthProblem($value, $negative: false);
38
+ @if $problem {
39
+ @error "`#{meta.inspect($value)}` is not a valid #{$name} for `background-dots`: #{$problem}. A browser drops the pattern.";
40
+ }
41
+ }
42
+ @if $image != null and meta.type-of($image) != "string" {
43
+ @error "`#{$image}` is not a valid $image for `background-dots`. Pass an image path as a string.";
44
+ }
45
+ @if $diagonal != true and $diagonal != false {
46
+ @error "`#{$diagonal}` is not a valid $diagonal for `background-dots`. Pass `true` or `false`.";
47
+ }
48
+ // Each colour goes into a radial gradient as `radial-gradient($color $size,
49
+ // ...)`. Measured in Chrome 152, a word or a quoted colour there drops the
50
+ // gradient, and a length is read as the gradient's size instead, so neither
51
+ // draws the dots meant; see scss/internal/_color-problem.scss.
52
+ @if $color != null {
53
+ @each $item in $color {
54
+ $problem: colorProblem($item);
55
+ @if $problem {
56
+ @error "`#{meta.inspect($item)}` is not a valid colour in $color for `background-dots`: #{$problem}. Pass one colour, or two for the diagonal variant, such as `red` or `var(--dot)`.";
57
+ }
58
+ }
59
+ }
60
+ @if not $color {
61
+ $color: rgba(0, 0, 0, 0.1);
62
+ @if $diagonal == true {
63
+ background-image: gradientOf(($color $size, transparent 0), radial, $member: "background-dots"),
64
+ gradientOf(($color $size, transparent 0), radial, $member: "background-dots");
65
+ background-position: calc($gutter / 2) calc($gutter / 2),
66
+ calc($gutter * 2) calc($gutter * 2);
67
+ } @else if $diagonal == false {
68
+ background-image: gradientOf(($color $size, transparent 0), radial, $member: "background-dots");
69
+ background-position: calc($gutter / 2) calc($gutter / 2);
70
+ }
71
+ } @else if $color {
72
+ @if $diagonal == true {
73
+ background-image: gradientOf((list.nth($color, 1) $size, transparent 0), radial, $member: "background-dots"),
74
+ gradientOf((list.nth($color, list.length($color)) $size, transparent 0), radial, $member: "background-dots");
75
+ background-position: calc($gutter / 2) calc($gutter / 2),
76
+ calc($gutter * 2) calc($gutter * 2);
77
+ } @else if $diagonal == false {
78
+ background-image: gradientOf((list.nth($color, 1) $size, transparent 0), radial, $member: "background-dots");
79
+ background-position: calc($gutter / 2) calc($gutter / 2);
80
+ @if list.length($color) > 1 {
81
+ @error "Please do not pass more than one argument when you disable 'diagonal' property! Simply remove the argument(s) after '#{list.nth($color, 1)}' to resolve the problem.";
82
+ }
83
+ }
84
+ }
85
+ background-size: $gutter $gutter;
86
+ background-repeat: repeat;
87
+ @if $image {
88
+ position: relative;
89
+ &::before {
90
+ content: "";
91
+ display: block;
92
+ position: absolute;
93
+ width: 100%;
94
+ height: 100%;
95
+ top: 0;
96
+ left: 0;
97
+ background-image: imageValue($image, "background-dots", "$image", $unquote: true);
98
+ background-repeat: no-repeat;
99
+ background-position: center;
100
+ background-size: cover;
101
+ z-index: -1;
102
+ }
103
+ }
104
+ }
@@ -0,0 +1,89 @@
1
+ @charset "UTF-8";
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
+ @use "../internal/image-value" as *;
9
+ @use "../internal/color-problem" as *;
10
+ @use "../internal/color-stops-problem" as *;
11
+ @use "../internal/gradient" as *;
12
+ @use "../internal/is-css-function" as *;
13
+
14
+ @mixin background-image(
15
+ $image-url: null,
16
+ $filter-color: null,
17
+ $filter-direction: null
18
+ ) {
19
+ // The direction used to be read only when there were two or more colours,
20
+ // so with one colour any value was dropped without a word, a typo included.
21
+ // Check it first, against what the gradient branches accept.
22
+ @if $filter-direction and gradientDirection($filter-direction) == null {
23
+ @error "`#{meta.inspect($filter-direction)}` is not a valid $filter-direction for `background-image`. Pass an angle such as `45deg` or `0.25turn`, `\"to top right\"`, or one of: #{map.keys($map-for-directions)}.";
24
+ }
25
+ // One filter colour is written into `linear-gradient(to top, $c, $c)` over an
26
+ // image, or into `background` when there is none; several are the stops of a
27
+ // gradient. Measured in Chrome 152, a word or a quoted colour drops either, and
28
+ // a length in `background` is read as a position, so none of them is a filter.
29
+ // CSS-wide keywords are refused, since they drop the gradient.
30
+ // With no $image-url the image sits in the markup and the filter is written
31
+ // as an ::after layer's `background`, where an image is as valid as a colour.
32
+ // Measured in Chrome 152 over an image in a style attribute, a
33
+ // linear-gradient drew a scrim, a radial-gradient a vignette and url() a
34
+ // pattern, so those are accepted there. `inherit` drew the same image over
35
+ // itself and `10px` an empty layer, so they stay refused. With an image the
36
+ // filter goes inside linear-gradient(), where a gradient dropped the whole
37
+ // declaration, image included.
38
+ // paint(), image() and -webkit-cross-fade() were kept as images in Chrome 152;
39
+ // cross-fade(), element() and -moz-element() are in the specification or other
40
+ // engines and are let through on the same grounds.
41
+ $overlay-image: not $image-url and isCssFunction($filter-color, "url" "image-set" "var" "linear-gradient" "radial-gradient" "conic-gradient" "repeating-linear-gradient" "repeating-radial-gradient" "repeating-conic-gradient" "paint" "image" "cross-fade" "-webkit-cross-fade" "element" "-moz-element");
42
+ @if $filter-color != null and not $overlay-image {
43
+ $problem: null;
44
+ @if list.length($filter-color) == 1 {
45
+ $problem: colorProblem($filter-color);
46
+ } @else {
47
+ $problem: colorStopsProblem($filter-color);
48
+ }
49
+ @if $problem {
50
+ @error "`#{meta.inspect($filter-color)}` is not a valid $filter-color for `background-image`: #{$problem}. Pass a colour, such as `rgba(0, 0, 0, 0.5)`, or several for a gradient.";
51
+ }
52
+ }
53
+ @if $image-url {
54
+ @if $filter-color {
55
+ @if list.length($filter-color) == 1 {
56
+ background-image: linear-gradient(to top, $filter-color, $filter-color),
57
+ imageValue($image-url, "background-image", "$image-url");
58
+ } @else if list.length($filter-color) > 1 {
59
+ background-image: gradientOf($filter-color, linear, $filter-direction or "top", $member: "background-image", $colors-name: "$filter-color", $direction-name: "$filter-direction"),
60
+ imageValue($image-url, "background-image", "$image-url");
61
+ }
62
+ } @else {
63
+ background-image: imageValue($image-url, "background-image", "$image-url");
64
+ }
65
+ } @else {
66
+ position: relative;
67
+ &::after {
68
+ content: "";
69
+ display: block;
70
+ position: absolute;
71
+ left: 0;
72
+ top: 0;
73
+ width: 100%;
74
+ height: 100%;
75
+ @if list.length($filter-color) == 1 {
76
+ background: $filter-color;
77
+ } @else if list.length($filter-color) > 1 {
78
+ background: gradientOf($filter-color, linear, $filter-direction or "top", $member: "background-image", $colors-name: "$filter-color", $direction-name: "$filter-direction");
79
+ }
80
+ }
81
+ & > * {
82
+ position: relative;
83
+ z-index: 1;
84
+ }
85
+ }
86
+ background-position: center center;
87
+ background-repeat: no-repeat;
88
+ background-size: cover;
89
+ }