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,40 @@
1
+ @charset "UTF-8";
2
+
3
+ @use "sass:list";
4
+ @use "../library/breakpoint" as *;
5
+
6
+ @mixin remove($params...) {
7
+ @if list.length($params) == 0 {
8
+ display: none;
9
+ } @else if list.length($params) == 1 {
10
+ $value: list.nth($params, 1);
11
+ // `only` rather than the one-argument form, which compiles to the same
12
+ // query, so the warning below names `remove` and is printed once.
13
+ @include breakpoint(only, $value) {
14
+ display: none;
15
+ }
16
+ @warn "`remove(#{$value})` hides the element only at a viewport exactly that wide, a single pixel. Write `remove(only, #{$value})` for that width, or `remove(min, #{$value})` from it upwards.";
17
+ } @else if list.length($params) == 2 {
18
+ @if list.index("min" "max", list.nth($params, 1)) {
19
+ $mode: list.nth($params, 1);
20
+ $value: list.nth($params, 2);
21
+ @if $mode == "min" {
22
+ @include breakpoint(min, $value) {
23
+ display: none;
24
+ }
25
+ } @else if $mode == "max" {
26
+ @include breakpoint(max, $value) {
27
+ display: none;
28
+ }
29
+ }
30
+ } @else {
31
+ $start: list.nth($params, 1);
32
+ $end: list.nth($params, 2);
33
+ @include breakpoint($start, $end) {
34
+ display: none;
35
+ }
36
+ }
37
+ } @else {
38
+ @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.";
39
+ }
40
+ }
@@ -0,0 +1,57 @@
1
+ @charset "UTF-8";
2
+
3
+ @mixin reset-css {
4
+ @if & {
5
+ @error "Please call the mixin at the root of your style sheet.";
6
+ } @else {
7
+ // http://meyerweb.com/eric/tools/css/reset/
8
+ // v2.0 | 20110126
9
+ // License: none (public domain)
10
+ //
11
+ // Comments in this file are `//`: a /* */ comment inside a mixin is emitted
12
+ // into the stylesheet of everyone who includes it.
13
+ html, body, div, span, applet, object, iframe,
14
+ h1, h2, h3, h4, h5, h6, p, blockquote, pre,
15
+ a, abbr, acronym, address, big, cite, code,
16
+ del, dfn, em, img, ins, kbd, q, s, samp,
17
+ small, strike, strong, sub, sup, tt, var,
18
+ b, u, i, center,
19
+ dl, dt, dd, ol, ul, li,
20
+ fieldset, form, label, legend,
21
+ table, caption, tbody, tfoot, thead, tr, th, td,
22
+ article, aside, canvas, details, embed,
23
+ figure, figcaption, footer, header, hgroup,
24
+ menu, nav, output, ruby, section, summary,
25
+ time, mark, audio, video {
26
+ margin: 0;
27
+ padding: 0;
28
+ border: 0;
29
+ font-size: 100%;
30
+ font: inherit;
31
+ vertical-align: baseline;
32
+ }
33
+ // HTML5 display-role reset for older browsers
34
+ article, aside, details, figcaption, figure,
35
+ footer, header, hgroup, menu, main, nav, section {
36
+ display: block;
37
+ }
38
+ body {
39
+ line-height: 1;
40
+ }
41
+ ol, ul {
42
+ list-style: none;
43
+ }
44
+ blockquote, q {
45
+ quotes: none;
46
+ }
47
+ blockquote:before, blockquote:after,
48
+ q:before, q:after {
49
+ content: '';
50
+ content: none;
51
+ }
52
+ table {
53
+ border-collapse: collapse;
54
+ border-spacing: 0;
55
+ }
56
+ }
57
+ }
@@ -0,0 +1,10 @@
1
+ @charset "UTF-8";
2
+
3
+ @use "../library/responsive-image" as *;
4
+
5
+ @mixin reset-figure {
6
+ margin: 0;
7
+ img {
8
+ @include responsive-image;
9
+ }
10
+ }
@@ -0,0 +1,34 @@
1
+ @charset "UTF-8";
2
+
3
+ @use "sass:meta";
4
+ @use "sass:string";
5
+ @use "../internal/keyword-value" as *;
6
+
7
+ // Measured in Chrome 152, `resize` kept none, both, horizontal, vertical, block,
8
+ // inline and auto, and `overflow` one or two of visible, hidden, clip, scroll,
9
+ // auto and overlay, all in any case, with the CSS-wide keywords on their own and
10
+ // var(). Both dropped a quoted keyword, three overflow values, and a CSS-wide
11
+ // keyword beside another, such as `overflow: inherit auto`. null leaves the
12
+ // declaration out, as it always has.
13
+ @mixin resizable($direction: both, $overflow: auto) {
14
+ $problem: keywordProblem($direction, "none" "both" "horizontal" "vertical" "block" "inline" "auto");
15
+ @if $problem {
16
+ @error "`#{meta.inspect($direction)}` is not a valid $direction for `resizable`: #{$problem}. A browser drops the declaration.";
17
+ }
18
+ $problem: keywordProblem($overflow, "visible" "hidden" "clip" "scroll" "auto" "overlay", 2);
19
+ @if $problem {
20
+ @error "`#{meta.inspect($overflow)}` is not a valid $overflow for `resizable`: #{$problem}. A browser drops the declaration.";
21
+ }
22
+ // Written without quotes, since `resize: "both"` was dropped.
23
+ @if meta.type-of($direction) == "string" {
24
+ resize: string.unquote($direction);
25
+ } @else {
26
+ resize: $direction;
27
+ }
28
+ @if meta.type-of($overflow) == "string" {
29
+ overflow: string.unquote($overflow);
30
+ } @else {
31
+ overflow: $overflow;
32
+ }
33
+ max-width: 100%;
34
+ }
@@ -0,0 +1,6 @@
1
+ @charset "UTF-8";
2
+
3
+ @mixin responsive-image {
4
+ display: block;
5
+ width: 100%;
6
+ }
@@ -0,0 +1,34 @@
1
+ @charset "UTF-8";
2
+
3
+ @use "sass:list";
4
+ @use "../utilities/validate-scissors" as *;
5
+
6
+ @mixin scissors($corners) {
7
+ @if list.length($corners) == 1 {
8
+ $corners: validateScissors($corners);
9
+ clip-path: polygon(
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)})
18
+ );
19
+ } @else if list.length($corners) == 4 {
20
+ $corners: validateScissors($corners);
21
+ clip-path: polygon(
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)})
30
+ );
31
+ } @else {
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.";
33
+ }
34
+ }
@@ -0,0 +1,34 @@
1
+ @charset "UTF-8";
2
+
3
+ @use "sass:meta";
4
+ @use "../internal/custom-property-in" as *;
5
+ @use "../internal/is-condition-value" as *;
6
+
7
+ @mixin screen-agent($resolution) {
8
+ $custom-property: customPropertyIn($resolution);
9
+ @if $custom-property {
10
+ @error "`#{$custom-property}` cannot be used as a resolution: custom properties are not evaluated in a @media condition, so the rule would never apply. Pass `1x`, `2x`, `3x` or a resolution such as `2dppx`.";
11
+ }
12
+ @if $resolution == "1x" {
13
+ @media (min-resolution: 96dpi) {
14
+ @content;
15
+ }
16
+ } @else if $resolution == "2x" {
17
+ @media (min-resolution: 192dpi) {
18
+ @content;
19
+ }
20
+ } @else if $resolution == "3x" {
21
+ @media (min-resolution: 288dpi) {
22
+ @content;
23
+ }
24
+ } @else {
25
+ // Measured in Chrome 152, `(min-resolution: huge)`, `(min-resolution: 2)`,
26
+ // `(min-resolution: 10px)` and `(min-resolution: -1dppx)` never match.
27
+ @if not isConditionValue($resolution, "resolution") {
28
+ @error "`#{meta.inspect($resolution)}` is not a valid $resolution for `screen-agent`: `(min-resolution: #{meta.inspect($resolution)})` would never match. Pass `1x`, `2x`, `3x`, or a resolution such as `2dppx`, `192dpi` or `38dpcm`.";
29
+ }
30
+ @media (min-resolution: #{$resolution}) {
31
+ @content;
32
+ }
33
+ }
34
+ }
@@ -0,0 +1,15 @@
1
+ @charset "UTF-8";
2
+
3
+ @use "sass:meta";
4
+ @use "../internal/length-problem" as *;
5
+
6
+ @mixin sizer($width, $height: $width) {
7
+ @each $name, $value in ("$width": $width, "$height": $height) {
8
+ $problem: sizeProblem($value);
9
+ @if $problem {
10
+ @error "`#{meta.inspect($value)}` is not a valid #{$name} for `sizer`: #{$problem}. A browser drops the declaration.";
11
+ }
12
+ }
13
+ width: $width;
14
+ height: $height;
15
+ }
@@ -0,0 +1,29 @@
1
+ @charset "UTF-8";
2
+
3
+ @use "sass:map";
4
+ @use "../maps/map-for-smartphones" as *;
5
+ @use "../utilities/map-deep-get" as *;
6
+
7
+ @mixin smartphone($device, $orientation: null) {
8
+ @if map.has-key($map-for-smartphones, $device) {
9
+ @if $orientation == portrait or $orientation == null {
10
+ @media only screen
11
+ and (device-width: mapDeepGet($map-for-smartphones, $device, 'width'))
12
+ and (device-height: mapDeepGet($map-for-smartphones, $device, 'height'))
13
+ and (orientation: portrait) {
14
+ @content;
15
+ }
16
+ } @else if $orientation == landscape {
17
+ @media only screen
18
+ and (device-width: mapDeepGet($map-for-smartphones, $device, 'height'))
19
+ and (device-height: mapDeepGet($map-for-smartphones, $device, 'width'))
20
+ and (orientation: landscape) {
21
+ @content;
22
+ }
23
+ } @else {
24
+ @error "`#{$orientation}` is not a valid $orientation for `smartphone`. Pass `portrait`, `landscape`, or no orientation at all.";
25
+ }
26
+ } @else {
27
+ @error "`#{$device}` is not a device known to `smartphone`. Pass one of: #{map.keys($map-for-smartphones)}.";
28
+ }
29
+ }
@@ -0,0 +1,100 @@
1
+ @charset "UTF-8";
2
+
3
+ @use "sass:list";
4
+ @use "sass:meta";
5
+ @use "sass:string";
6
+ @use "../internal/length-problem" as *;
7
+
8
+ $-places: "left" "center" "right" "top" "bottom";
9
+
10
+ // What is wrong with $position as a background-position, or null. Measured in
11
+ // Chrome 152, background-position kept one or two lengths, percentages or
12
+ // place keywords, keywords with offsets such as `left 10px top 5px`, var(),
13
+ // maths functions and a CSS-wide keyword alone. It dropped a unitless number
14
+ // other than 0, a unit that is not a length, any other word or colour, an image,
15
+ // and three or four lengths with no keyword. Interpolation, as in
16
+ // `#{$x}px #{$y}px`, gives the same value as strings, so each part is read.
17
+ @function -position-problem($position) {
18
+ $parts: $position;
19
+ @if meta.type-of($position) == "string" and string.slice(meta.inspect($position), 1, 1) != "\"" and not string.index($position, "(") and string.index($position, " ") {
20
+ $parts: ();
21
+ $text: $position;
22
+ $at: string.index($text, " ");
23
+ @while $at {
24
+ @if $at > 1 {
25
+ $parts: list.append($parts, string.unquote(string.slice($text, 1, $at - 1)));
26
+ }
27
+ $text: string.slice($text, $at + 1);
28
+ $at: string.index($text, " ");
29
+ }
30
+ $parts: list.append($parts, string.unquote($text));
31
+ } @else if meta.type-of($position) != "list" {
32
+ $parts: ($position,);
33
+ }
34
+ @if list.length($parts) > 4 {
35
+ @return "a background position takes at most four values";
36
+ }
37
+ $keywords: 0;
38
+ @each $part in $parts {
39
+ @if meta.type-of($part) == "string" and list.index($-places, string.to-lower-case($part)) {
40
+ $keywords: $keywords + 1;
41
+ } @else {
42
+ $problem: lengthProblem($part, $css-wide: list.length($parts) == 1);
43
+ @if $problem == "it is not a length" {
44
+ @return "`#{meta.inspect($part)}` is not a length or one of left, center, right, top or bottom";
45
+ } @else if $problem {
46
+ @return "in `#{meta.inspect($part)}`, #{$problem}";
47
+ }
48
+ }
49
+ }
50
+ @if list.length($parts) > 2 and $keywords == 0 {
51
+ @return "three or four values need place keywords, such as `left 10px top 5px`";
52
+ }
53
+ @return null;
54
+ }
55
+
56
+ @mixin sprite($params...) {
57
+ @if list.length($params) == 1 {
58
+ @if meta.type-of(list.nth($params, 1)) == "string" {
59
+ $str-length: string.length(list.nth($params, 1));
60
+ $str-end: string.slice(list.nth($params, 1), $str-length - 3);
61
+ @if list.index(".png" ".jpg" ".svg", $str-end) {
62
+ $image-url: list.nth($params, 1);
63
+ display: inline-block;
64
+ background-image: url($image-url);
65
+ background-repeat: no-repeat;
66
+ } @else {
67
+ @error "`#{list.nth($params, 1)}` is not a valid image path for `sprite`. The path must end in .png, .jpg or .svg.";
68
+ }
69
+ } @else {
70
+ $position: list.nth($params, 1);
71
+ $problem: -position-problem($position);
72
+ @if $problem {
73
+ @error "`#{meta.inspect($position)}` is not a valid position for `sprite`: #{$problem}. A browser drops the declaration.";
74
+ }
75
+ background-position: $position;
76
+ }
77
+ } @else if list.length($params) == 2 {
78
+ $image-url: list.nth($params, 1);
79
+ $position: list.nth($params, 2);
80
+ // The one-argument form checks its path; this one did not, so a list was
81
+ // written into url(), which a browser drops, and a number asked for a file
82
+ // of that name. Measured in Chrome 152: `url(16 9)` was dropped.
83
+ @if meta.type-of($image-url) != "string" {
84
+ @error "`#{meta.inspect($image-url)}` is not a valid image path for `sprite`: with two arguments the first is one path as a string, and a browser drops a list in `url()`. Pass a path such as `\"/img/sprite.png\"`, then the position.";
85
+ }
86
+ @if $position != null {
87
+ $problem: -position-problem($position);
88
+ @if $problem {
89
+ @error "`#{meta.inspect($position)}` is not a valid position for `sprite`: #{$problem}. A browser drops the declaration.";
90
+ }
91
+ }
92
+ display: inline-block;
93
+ background-image: url($image-url);
94
+ background-position: $position;
95
+ background-repeat: no-repeat;
96
+ } @else {
97
+ @error "`sprite` takes 1 or 2 arguments; you passed #{list.length($params)}. Pass an image path, a background position, or both in that order.";
98
+ }
99
+ @content;
100
+ }
@@ -0,0 +1,21 @@
1
+ @charset "UTF-8";
2
+
3
+ @use "sass:list";
4
+
5
+ @mixin stretched-link($value: "before") {
6
+ @if list.index("before" "after", $value) {
7
+ &#{"::" + $value} {
8
+ content: "";
9
+ position: absolute;
10
+ pointer-events: auto;
11
+ background-color: rgba(0, 0, 0, 0);
12
+ top: 0;
13
+ right: 0;
14
+ bottom: 0;
15
+ left: 0;
16
+ z-index: 1;
17
+ }
18
+ } @else {
19
+ @error "'#{$value}' is a wrong argument. This mixin accepts 'before' or 'after' as an argument. If you don't pass any argument default it will target the '::before' pseudo-element of the selected element.";
20
+ }
21
+ }
@@ -0,0 +1,29 @@
1
+ @charset "UTF-8";
2
+
3
+ @use "sass:map";
4
+ @use "../maps/map-for-tablets" as *;
5
+ @use "../utilities/map-deep-get" as *;
6
+
7
+ @mixin tablet($device, $orientation: null) {
8
+ @if map.has-key($map-for-tablets, $device) {
9
+ @if $orientation == portrait or $orientation == null {
10
+ @media only screen
11
+ and (device-width: mapDeepGet($map-for-tablets, $device, 'width'))
12
+ and (device-height: mapDeepGet($map-for-tablets, $device, 'height'))
13
+ and (orientation: portrait) {
14
+ @content;
15
+ }
16
+ } @else if $orientation == landscape {
17
+ @media only screen
18
+ and (device-width: mapDeepGet($map-for-tablets, $device, 'height'))
19
+ and (device-height: mapDeepGet($map-for-tablets, $device, 'width'))
20
+ and (orientation: landscape) {
21
+ @content;
22
+ }
23
+ } @else {
24
+ @error "`#{$orientation}` is not a valid $orientation for `tablet`. Pass `portrait`, `landscape`, or no orientation at all.";
25
+ }
26
+ } @else {
27
+ @error "`#{$device}` is not a device known to `tablet`. Pass one of: #{map.keys($map-for-tablets)}.";
28
+ }
29
+ }
@@ -0,0 +1,48 @@
1
+ @charset "UTF-8";
2
+
3
+ @use "sass:list";
4
+ @use "sass:meta";
5
+ @use "sass:string";
6
+ @use "../internal/gradient" as *;
7
+
8
+ // Fills the letters with a gradient: the gradient mixin's arguments, and
9
+ // background-clip: text. The gradient is built and checked in
10
+ // scss/internal/_gradient.scss.
11
+ //
12
+ // The colours come first since 3.0.0, as in gradient, so a direction, a type
13
+ // and a colour space can all be left out. A call in the old order,
14
+ // `text-gradient("top", (red, blue))`, would otherwise fail on `"top"` not
15
+ // being a colour, so it is caught and answered with the new form.
16
+ //
17
+ // It still writes the background shorthand rather than background-image, so a
18
+ // call in the new order compiles to exactly what the same call compiled to in
19
+ // the old order.
20
+ @mixin text-gradient(
21
+ $colors,
22
+ $type: linear,
23
+ $direction: null,
24
+ $shape: null,
25
+ $position: null,
26
+ $from: null,
27
+ $in: null,
28
+ $repeating: false
29
+ ) {
30
+ @if gradientDirection($colors) != null and not list.index("linear" "radial" "conic", string.to-lower-case("#{$type}")) {
31
+ $written: meta.inspect($type);
32
+ @if list.separator($type) == "comma" {
33
+ $written: "(#{$written})";
34
+ }
35
+ @error "`text-gradient` takes the colours first since 3.0.0. Write `text-gradient(#{$written}, $direction: #{meta.inspect($colors)})`.";
36
+ }
37
+ $value: gradientOf($colors, $type, $direction, $shape, $position, $from, $in, $repeating, $member: "text-gradient");
38
+ // Written without the space first, as the gradient mixin does, for a browser
39
+ // that does not know `in`.
40
+ @if $in != null {
41
+ background: gradientOf($colors, $type, $direction, $shape, $position, $from, null, $repeating, $member: "text-gradient", $warn: false);
42
+ }
43
+ background: $value;
44
+ -webkit-background-clip: text;
45
+ -webkit-text-fill-color: transparent;
46
+ background-clip: text;
47
+ color: transparent;
48
+ }
@@ -0,0 +1,15 @@
1
+ @charset "UTF-8";
2
+
3
+ @use "../internal/image-value" as *;
4
+
5
+ @mixin text-image($image: null) {
6
+ @if $image {
7
+ background-image: imageValue($image, "text-image", "$image");
8
+ }
9
+ background-size: cover;
10
+ background-position: center;
11
+ -webkit-background-clip: text;
12
+ -webkit-text-fill-color: transparent;
13
+ background-clip: text;
14
+ color: transparent;
15
+ }
@@ -0,0 +1,22 @@
1
+ @charset "UTF-8";
2
+
3
+ @mixin text-selection($value: null) {
4
+ @if not & and $value == null {
5
+ ::selection {
6
+ @content;
7
+ }
8
+ } @else if & and $value == "only" {
9
+ &::selection {
10
+ @content;
11
+ }
12
+ } @else if & and $value == null {
13
+ &::selection,
14
+ *::selection {
15
+ @content;
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.";
21
+ }
22
+ }
@@ -0,0 +1,145 @@
1
+ @charset "UTF-8";
2
+
3
+ @use "sass:color";
4
+ @use "sass:list";
5
+ @use "sass:math";
6
+ @use "sass:meta";
7
+ @use "../utilities/clear-unit" as *;
8
+
9
+ @mixin text-shadow($params...) {
10
+ $value: ();
11
+
12
+ @for $i from 1 through list.length($params) {
13
+ // Takes each items come from $params.
14
+ $item: list.nth($params, $i);
15
+
16
+ // Each group must carry at least a direction, a colour and a size. Without
17
+ // this the list.nth() calls below fail with "Invalid index", which says nothing
18
+ // about what the mixin wanted.
19
+ @if list.length($item) < 3 {
20
+ @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.";
21
+ }
22
+
23
+ // The first value comes from the $item is direction.
24
+ // This will be used in the @if, @else statements with $size to control the offset of the shadows.
25
+ $direction: list.nth($item, 1);
26
+
27
+ // Second value is the color.
28
+ $color: list.nth($item, 2);
29
+
30
+ // The third value is the actual offset value of the shadows.
31
+ $size: list.nth($item, 3);
32
+
33
+ // Takes the unit of the $size value to use it later to increment the amount of shadow based on the unit.
34
+ $sizeUnit: math.unit($size);
35
+
36
+ // The $blur argument is optional. It controls the size of the blur.
37
+ $blur: null;
38
+
39
+ // The $fill argument is optional. This makes shadow fill the gap between the actual text and shadow's end-point. The default value is set to false.
40
+ $fill: null;
41
+
42
+ // Assigns the optional sub-arguments to the actual argument.
43
+ @if list.length($item) == 4 and meta.type-of(list.nth($item, 4)) == number {
44
+ $blur: list.nth($item, list.length($item));
45
+ } @else if list.length($item) == 4 and meta.type-of(list.nth($item, 4)) == bool {
46
+ $fill: list.nth($item, list.length($item));
47
+ } @else if list.length($item) == 5 {
48
+ $blur: list.nth($item, 4);
49
+ $fill: list.nth($item, list.length($item));
50
+ }
51
+
52
+ // The code below changes the angle of $direction of the shadow based on the predefined values.
53
+ @if $direction == "top" {
54
+ @if $fill == true {
55
+ // The clearUnit(); function is used here due to it is not possible to count $size with a unit. First, it clears the unit from the $size argument and then adds it back again in the @for loop.
56
+ @for $i from 1 through clearUnit($size) {
57
+ $increase: $i * 1 + $sizeUnit;
58
+ $shadow: 0 -#{$increase} $blur $color;
59
+ $value: list.append($value, $shadow, comma);
60
+ }
61
+ } @else {
62
+ $shadow: 0 -#{$size} $blur $color;
63
+ $value: list.append($value, $shadow, comma);
64
+ }
65
+ } @else if $direction == "top-left" {
66
+ @if $fill == true {
67
+ @for $i from 1 through clearUnit($size) {
68
+ $increase: $i * 1 + $sizeUnit;
69
+ $shadow: -#{$increase} -#{$increase} $blur $color;
70
+ $value: list.append($value, $shadow, comma);
71
+ }
72
+ } @else {
73
+ $shadow: -#{$size} -#{$size} $blur $color;
74
+ $value: list.append($value, $shadow, comma);
75
+ }
76
+ } @else if $direction == "top-right" {
77
+ @if $fill == true {
78
+ @for $i from 1 through clearUnit($size) {
79
+ $increase: $i * 1 + $sizeUnit;
80
+ $shadow: #{$increase} -#{$increase} $blur $color;
81
+ $value: list.append($value, $shadow, comma);
82
+ }
83
+ } @else {
84
+ $shadow: #{$size} -#{$size} $blur $color;
85
+ $value: list.append($value, $shadow, comma);
86
+ }
87
+ } @else if $direction == "bottom" {
88
+ @if $fill == true {
89
+ @for $i from 1 through clearUnit($size) {
90
+ $increase: $i * 1 + $sizeUnit;
91
+ $shadow: 0 #{$increase} $blur $color;
92
+ $value: list.append($value, $shadow, comma);
93
+ }
94
+ } @else {
95
+ $shadow: 0 #{$size} $blur $color;
96
+ $value: list.append($value, $shadow, comma);
97
+ }
98
+ } @else if $direction == "bottom-left" {
99
+ @if $fill == true {
100
+ @for $i from 1 through clearUnit($size) {
101
+ $increase: $i * 1 + $sizeUnit;
102
+ $shadow: -#{$increase} #{$increase} $blur $color;
103
+ $value: list.append($value, $shadow, comma);
104
+ }
105
+ } @else {
106
+ $shadow: -#{$size} #{$size} $blur $color;
107
+ $value: list.append($value, $shadow, comma);
108
+ }
109
+ } @else if $direction == "bottom-right" {
110
+ @if $fill == true {
111
+ @for $i from 1 through clearUnit($size) {
112
+ $increase: $i * 1 + $sizeUnit;
113
+ $shadow: #{$increase} #{$increase} $blur $color;
114
+ $value: list.append($value, $shadow, comma);
115
+ }
116
+ } @else {
117
+ $shadow: #{$size} #{$size} $blur $color;
118
+ $value: list.append($value, $shadow, comma);
119
+ }
120
+ } @else if $direction == "left" {
121
+ @if $fill == true {
122
+ @for $i from 1 through clearUnit($size) {
123
+ $increase: $i * 1 + $sizeUnit;
124
+ $shadow: -#{$increase} 0 $blur $color;
125
+ $value: list.append($value, $shadow, comma);
126
+ }
127
+ } @else {
128
+ $shadow: -#{$size} 0 $blur $color;
129
+ $value: list.append($value, $shadow, comma);
130
+ }
131
+ } @else if $direction == "right" {
132
+ @if $fill == true {
133
+ @for $i from 1 through clearUnit($size) {
134
+ $increase: $i * 1 + $sizeUnit;
135
+ $shadow: #{$increase} 0 $blur $color;
136
+ $value: list.append($value, $shadow, comma);
137
+ }
138
+ } @else {
139
+ $shadow: #{$size} 0 $blur $color;
140
+ $value: list.append($value, $shadow, comma);
141
+ }
142
+ }
143
+ }
144
+ text-shadow: $value;
145
+ }