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.
- checksums.yaml +4 -4
- data/LICENSE.md +13 -0
- data/README.md +328 -0
- data/SKILL.md +282 -0
- data/gerillass.json +2713 -0
- data/lib/gerillass/engine.rb +55 -0
- data/lib/gerillass/jekyll.rb +13 -0
- data/lib/gerillass.rb +26 -0
- data/scss/_gerillass.scss +15 -0
- data/scss/internal/_color-problem.scss +99 -0
- data/scss/internal/_color-stops-problem.scss +94 -0
- data/scss/internal/_condition-width.scss +22 -0
- data/scss/internal/_custom-property-in.scss +25 -0
- data/scss/internal/_gradient.scss +425 -0
- data/scss/internal/_image-value.scss +68 -0
- data/scss/internal/_is-condition-value.scss +94 -0
- data/scss/internal/_is-css-function.scss +21 -0
- data/scss/internal/_is-size.scss +22 -0
- data/scss/internal/_keyword-value.scss +76 -0
- data/scss/internal/_length-problem.scss +127 -0
- data/scss/internal/_sibling-index.scss +51 -0
- data/scss/internal/_words.scss +35 -0
- data/scss/library/_adaptive.scss +31 -0
- data/scss/library/_after.scss +28 -0
- data/scss/library/_all-buttons.scss +21 -0
- data/scss/library/_all-text-inputs.scss +21 -0
- data/{core → scss}/library/_antialias.scss +5 -1
- data/scss/library/_aspect-ratio.scss +27 -0
- data/scss/library/_background-dots.scss +104 -0
- data/scss/library/_background-image.scss +89 -0
- data/scss/library/_background-stripes.scss +88 -0
- data/scss/library/_before.scss +28 -0
- data/scss/library/_border-box.scss +30 -0
- data/scss/library/_border-radius.scss +164 -0
- data/scss/library/_brand-logo.scss +33 -0
- data/scss/library/_breakpoint.scss +96 -0
- data/scss/library/_breakpointer.scss +40 -0
- data/scss/library/_center.scss +19 -0
- data/scss/library/_circle.scss +15 -0
- data/{core → scss}/library/_clearfix.scss +1 -1
- data/scss/library/_columnizer.scss +125 -0
- data/scss/library/_container-query.scss +119 -0
- data/scss/library/_container.scss +72 -0
- data/scss/library/_counter.scss +59 -0
- data/scss/library/_ellipsis.scss +87 -0
- data/scss/library/_escape-to-parent.scss +12 -0
- data/scss/library/_except.scss +71 -0
- data/scss/library/_focus-ring.scss +63 -0
- data/scss/library/_font-face.scss +240 -0
- data/scss/library/_gradient.scss +31 -0
- data/scss/library/_hide.scss +25 -0
- data/scss/library/_index.scss +57 -0
- data/scss/library/_line-clamp.scss +38 -0
- data/scss/library/_loadify.scss +62 -0
- data/scss/library/_motion-safe.scss +28 -0
- data/scss/library/_only.scss +73 -0
- data/scss/library/_placeholder-shown.scss +7 -0
- data/scss/library/_placeholder.scss +19 -0
- data/scss/library/_position.scss +72 -0
- data/scss/library/_remove.scss +40 -0
- data/scss/library/_reset-css.scss +57 -0
- data/scss/library/_reset-figure.scss +10 -0
- data/scss/library/_resizable.scss +34 -0
- data/scss/library/_responsive-image.scss +6 -0
- data/scss/library/_scissors.scss +34 -0
- data/scss/library/_screen-agent.scss +34 -0
- data/scss/library/_sizer.scss +15 -0
- data/scss/library/_smartphone.scss +29 -0
- data/scss/library/_sprite.scss +100 -0
- data/scss/library/_stretched-link.scss +21 -0
- data/scss/library/_tablet.scss +29 -0
- data/scss/library/_text-gradient.scss +48 -0
- data/scss/library/_text-image.scss +15 -0
- data/scss/library/_text-selection.scss +22 -0
- data/scss/library/_text-shadow.scss +145 -0
- data/scss/library/_text-stroke.scss +43 -0
- data/scss/library/_tokens.scss +111 -0
- data/scss/library/_triangle.scss +115 -0
- data/scss/lists/_index.scss +8 -0
- data/scss/lists/_list-of-anchor-pseudo-classes.scss +9 -0
- data/scss/lists/_list-of-buttons.scss +8 -0
- data/scss/lists/_list-of-counter-styles.scss +59 -0
- data/scss/lists/_list-of-directions.scss +12 -0
- data/scss/lists/_list-of-length-units.scss +23 -0
- data/scss/lists/_list-of-text-inputs.scss +20 -0
- data/scss/maps/_index.scss +8 -0
- data/scss/maps/_map-for-breakpoints.scss +9 -0
- data/scss/maps/_map-for-directions.scss +12 -0
- data/scss/maps/_map-for-font-formats.scss +9 -0
- data/scss/maps/_map-for-positions.scss +13 -0
- data/scss/maps/_map-for-smartphones.scss +72 -0
- data/scss/maps/_map-for-tablets.scss +32 -0
- data/scss/utilities/_clear-unit.scss +11 -0
- data/scss/utilities/_clear-whitespace.scss +15 -0
- data/scss/utilities/_convert-to-em.scss +16 -0
- data/scss/utilities/_convert-to-number.scss +45 -0
- data/scss/utilities/_fill-nulls.scss +18 -0
- data/scss/utilities/_fluid.scss +76 -0
- data/scss/utilities/_font-sizer.scss +19 -0
- data/scss/utilities/_font-source.scss +23 -0
- data/scss/utilities/_gradient-value.scss +24 -0
- data/scss/utilities/_index.scss +26 -0
- data/scss/utilities/_is-color.scss +16 -0
- data/scss/utilities/_is-gutter.scss +24 -0
- data/scss/utilities/_is-number.scss +11 -0
- data/scss/utilities/_is-time.scss +14 -0
- data/scss/utilities/_map-deep-get.scss +10 -0
- data/scss/utilities/_pixelify.scss +20 -0
- data/scss/utilities/_pseudo-selector.scss +12 -0
- data/scss/utilities/_remify.scss +16 -0
- data/scss/utilities/_shade.scss +10 -0
- data/scss/utilities/_shorthand-property.scss +17 -0
- data/scss/utilities/_tint.scss +10 -0
- data/scss/utilities/_validate-breakpoint.scss +41 -0
- data/scss/utilities/_validate-length.scss +37 -0
- data/scss/utilities/_validate-ratio.scss +77 -0
- data/scss/utilities/_validate-scissors.scss +34 -0
- metadata +131 -46
- data/core/_gerillass.scss +0 -4
- data/core/library/_before.scss +0 -18
- data/core/library/_border-box.scss +0 -26
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
@charset "UTF-8";
|
|
2
|
+
|
|
3
|
+
@use "sass:list";
|
|
4
|
+
@use "sass:math";
|
|
5
|
+
@use "sass:meta";
|
|
6
|
+
@use "sass:string";
|
|
7
|
+
@use "../internal/is-size" as *;
|
|
8
|
+
@use "../internal/image-value" as *;
|
|
9
|
+
@use "../internal/color-problem" as *;
|
|
10
|
+
@use "../internal/length-problem" as *;
|
|
11
|
+
@use "../internal/gradient" as *;
|
|
12
|
+
|
|
13
|
+
@mixin background-stripes(
|
|
14
|
+
$color: null,
|
|
15
|
+
$thickness: 1em,
|
|
16
|
+
$rotation: -45deg,
|
|
17
|
+
$image: null
|
|
18
|
+
) {
|
|
19
|
+
// The arithmetic below runs in calc() so var() and clamp() work; on plain
|
|
20
|
+
// lengths Sass simplifies it back to the same number.
|
|
21
|
+
@if not isSize($thickness) {
|
|
22
|
+
@error "`#{meta.inspect($thickness)}` is not a valid $thickness for `background-stripes`. Pass a length, or var(), env() or a calculation such as `clamp()`.";
|
|
23
|
+
}
|
|
24
|
+
// isSize takes any number. The thickness is a colour stop's position, which
|
|
25
|
+
// in Chrome 152 kept a percentage and a negative length and dropped a unitless
|
|
26
|
+
// number other than 0 and a unit that is not a length.
|
|
27
|
+
$thickness-problem: lengthProblem($thickness);
|
|
28
|
+
@if $thickness-problem {
|
|
29
|
+
@error "`#{meta.inspect($thickness)}` is not a valid $thickness for `background-stripes`: #{$thickness-problem}. A browser drops the gradient.";
|
|
30
|
+
}
|
|
31
|
+
@if meta.type-of($rotation) != "number" {
|
|
32
|
+
@error "`#{$rotation}` is not a valid $rotation for `background-stripes`. Pass an angle such as `-45deg`, or a unitless number which is treated as degrees.";
|
|
33
|
+
}
|
|
34
|
+
@if $image != null and meta.type-of($image) != "string" {
|
|
35
|
+
@error "`#{$image}` is not a valid $image for `background-stripes`. Pass an image path as a string.";
|
|
36
|
+
}
|
|
37
|
+
// A unitless rotation is read as degrees. `deg` used to be added to any unit
|
|
38
|
+
// that was not deg, so a valid `0.25turn` became `0.25turndeg` and `-10px`
|
|
39
|
+
// became `-10pxdeg`, both dropped. Measured in Chrome 152, a gradient kept
|
|
40
|
+
// deg, grad, rad and turn in any case (`10DEG`, `0.25TURN`) and a unitless 0,
|
|
41
|
+
// and dropped a unitless 45, `-10px` and `10%`.
|
|
42
|
+
// Each colour becomes a stripe in a repeating gradient, where a word or a
|
|
43
|
+
// quoted colour drops the whole pattern; see scss/internal/_color-problem.scss.
|
|
44
|
+
@if $color != null {
|
|
45
|
+
@each $item in $color {
|
|
46
|
+
$problem: colorProblem($item);
|
|
47
|
+
@if $problem {
|
|
48
|
+
@error "`#{meta.inspect($item)}` is not a valid colour in $color for `background-stripes`: #{$problem}. Pass one colour or several, such as `red` or `red var(--stripe)`.";
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
$validate-unit: $rotation;
|
|
53
|
+
@if math.is-unitless($rotation) {
|
|
54
|
+
$validate-unit: $rotation + deg;
|
|
55
|
+
} @else if not list.index("deg" "grad" "rad" "turn", string.to-lower-case(math.unit($rotation))) {
|
|
56
|
+
@error "`#{meta.inspect($rotation)}` is not a valid $rotation for `background-stripes`: `#{math.unit($rotation)}` is not an angle unit, and a browser drops the gradient. Pass an angle in deg, grad, rad or turn, such as `-45deg`, or a unitless number, which is read as degrees.";
|
|
57
|
+
}
|
|
58
|
+
$get-image: if($image, string.unquote(", ") + imageValue($image, "background-stripes", "$image", $unquote: true), string.unquote(""));
|
|
59
|
+
@if not $color {
|
|
60
|
+
$color: rgba(0, 0, 0, 0.1);
|
|
61
|
+
background-image: gradientOf(($color 0, $color $thickness, transparent $thickness, transparent calc($thickness * 2)), linear, $validate-unit, $repeating: true, $member: "background-stripes") + $get-image;
|
|
62
|
+
@if $image {
|
|
63
|
+
background-position: center;
|
|
64
|
+
background-repeat: no-repeat;
|
|
65
|
+
background-size: cover;
|
|
66
|
+
}
|
|
67
|
+
} @else if list.length($color) == 1 {
|
|
68
|
+
background-image: gradientOf(($color 0, $color $thickness, transparent $thickness, transparent calc($thickness * 2)), linear, $validate-unit, $repeating: true, $member: "background-stripes") + $get-image;
|
|
69
|
+
@if $image {
|
|
70
|
+
background-position: center;
|
|
71
|
+
background-repeat: no-repeat;
|
|
72
|
+
background-size: cover;
|
|
73
|
+
}
|
|
74
|
+
} @else if list.length($color) > 1 {
|
|
75
|
+
$list: ();
|
|
76
|
+
@for $i from 1 through list.length($color) {
|
|
77
|
+
$index-color: list.nth($color, $i);
|
|
78
|
+
$list: list.append($list, $index-color calc($thickness * $i - $thickness), comma);
|
|
79
|
+
$list: list.append($list, $index-color calc($thickness * $i), comma);
|
|
80
|
+
}
|
|
81
|
+
background-image: gradientOf($list, linear, $validate-unit, $repeating: true, $member: "background-stripes") + $get-image;
|
|
82
|
+
@if $image {
|
|
83
|
+
background-position: center;
|
|
84
|
+
background-repeat: no-repeat;
|
|
85
|
+
background-size: cover;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
@@ -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 before($content: null) {
|
|
8
|
+
&::before {
|
|
9
|
+
@if $content == null {
|
|
10
|
+
@content;
|
|
11
|
+
} @else if meta.type-of($content) != "string" {
|
|
12
|
+
@error "`#{$content}` is not a valid $content for `before`. 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,30 @@
|
|
|
1
|
+
@charset "UTF-8";
|
|
2
|
+
|
|
3
|
+
@mixin border-box($value: null) {
|
|
4
|
+
@if not & and $value == null {
|
|
5
|
+
*,
|
|
6
|
+
*::before,
|
|
7
|
+
*::after {
|
|
8
|
+
box-sizing: border-box;
|
|
9
|
+
}
|
|
10
|
+
} @else if & and $value == "only" {
|
|
11
|
+
&,
|
|
12
|
+
&::before,
|
|
13
|
+
&::after {
|
|
14
|
+
box-sizing: border-box;
|
|
15
|
+
}
|
|
16
|
+
} @else if & and $value == null {
|
|
17
|
+
&,
|
|
18
|
+
&::before,
|
|
19
|
+
&::after,
|
|
20
|
+
*,
|
|
21
|
+
*::before,
|
|
22
|
+
*::after {
|
|
23
|
+
box-sizing: border-box;
|
|
24
|
+
}
|
|
25
|
+
} @else if not & and $value == "only" {
|
|
26
|
+
@error "`only` has no meaning at the root of a stylesheet, because there is no selector to limit the effect to. Call `border-box(\"only\")` inside a selector, or pass no argument at all.";
|
|
27
|
+
} @else {
|
|
28
|
+
@error "`#{$value}` is not a valid argument for `border-box`. Pass `\"only\"` inside a selector to affect just that element, or pass no argument at all.";
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
@charset "UTF-8";
|
|
2
|
+
|
|
3
|
+
@use "sass:list";
|
|
4
|
+
@use "sass:meta";
|
|
5
|
+
@use "sass:string";
|
|
6
|
+
@use "../lists/list-of-directions" as *;
|
|
7
|
+
@use "../utilities/fill-nulls" as *;
|
|
8
|
+
@use "../internal/length-problem" as *;
|
|
9
|
+
|
|
10
|
+
// The parts of $text between the separator, empty parts left out.
|
|
11
|
+
@function -split($text, $separator) {
|
|
12
|
+
$parts: ();
|
|
13
|
+
$at: string.index($text, $separator);
|
|
14
|
+
@while $at {
|
|
15
|
+
@if $at > 1 {
|
|
16
|
+
$parts: list.append($parts, string.unquote(string.slice($text, 1, $at - 1)));
|
|
17
|
+
}
|
|
18
|
+
$text: string.slice($text, $at + 1);
|
|
19
|
+
$at: string.index($text, $separator);
|
|
20
|
+
}
|
|
21
|
+
@if string.length($text) > 0 {
|
|
22
|
+
$parts: list.append($parts, string.unquote($text));
|
|
23
|
+
}
|
|
24
|
+
@return $parts;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// What is wrong with $value as the radii of one declaration, or null. Measured
|
|
28
|
+
// in Chrome 152: border-radius kept one to four radii, and a slash between two
|
|
29
|
+
// such sets; a corner's own property kept one or two radii and no slash. Both
|
|
30
|
+
// kept a length, 0, a percentage and a CSS-wide keyword alone, and dropped a
|
|
31
|
+
// negative radius, a keyword such as auto, and more radii than that.
|
|
32
|
+
// Interpolation, as in `#{$a}/#{$b}`, gives the same value as a string, so a
|
|
33
|
+
// string is read by its parts. null is a corner left out, as fillNulls has it.
|
|
34
|
+
@function -radii-problem($value, $max, $slash: false) {
|
|
35
|
+
@if $value == null {
|
|
36
|
+
@return null;
|
|
37
|
+
}
|
|
38
|
+
$is-text: meta.type-of($value) == "string" and string.slice(meta.inspect($value), 1, 1) != "\"" and not string.index($value, "(");
|
|
39
|
+
@if ($is-text and string.index($value, "/")) or (meta.type-of($value) == "list" and list.separator($value) == "slash") {
|
|
40
|
+
$sets: $value;
|
|
41
|
+
@if $is-text {
|
|
42
|
+
$sets: -split($value, "/");
|
|
43
|
+
}
|
|
44
|
+
@if not $slash {
|
|
45
|
+
@return "a slash only works in the one-argument form, between two sets of radii";
|
|
46
|
+
}
|
|
47
|
+
@if list.length($sets) != 2 {
|
|
48
|
+
@return "a slash goes between exactly two sets of radii";
|
|
49
|
+
}
|
|
50
|
+
@each $set in $sets {
|
|
51
|
+
$problem: -radii-problem($set, $max);
|
|
52
|
+
@if $problem {
|
|
53
|
+
@return $problem;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
@return null;
|
|
57
|
+
}
|
|
58
|
+
$radii: $value;
|
|
59
|
+
@if $is-text and string.index($value, " ") {
|
|
60
|
+
$radii: -split($value, " ");
|
|
61
|
+
}
|
|
62
|
+
@if list.length($radii) > $max {
|
|
63
|
+
@return "it is #{list.length($radii)} radii where at most #{$max} are meant";
|
|
64
|
+
}
|
|
65
|
+
@each $radius in $radii {
|
|
66
|
+
@if $radius != null {
|
|
67
|
+
$problem: lengthProblem($radius, $negative: false, $css-wide: list.length($radii) == 1);
|
|
68
|
+
@if $problem {
|
|
69
|
+
@return $problem;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
@return null;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
@mixin border-radius($args...) {
|
|
77
|
+
// Logical corners are named block side first, inline side second, like the
|
|
78
|
+
// properties they map to. Every name here needs a branch below: the chain has
|
|
79
|
+
// no final @else, so a name without one would be accepted and emit nothing.
|
|
80
|
+
$logical: ("start-start", "start-end", "end-start", "end-end", "inline-start", "inline-end", "block-start", "block-end");
|
|
81
|
+
$list: list.join(list.join($list-of-directions, ("cross-left", "cross-right", "all")), $logical);
|
|
82
|
+
@if list.length($args) == 1 {
|
|
83
|
+
$value: list.nth($args, 1);
|
|
84
|
+
$problem: -radii-problem($value, 4, $slash: true);
|
|
85
|
+
@if $problem {
|
|
86
|
+
@error "`#{meta.inspect($value)}` is not a valid radius for `border-radius`: #{$problem}. A browser drops the declaration.";
|
|
87
|
+
}
|
|
88
|
+
border-radius: fillNulls($value, space);
|
|
89
|
+
} @else if list.length($args) == 2 {
|
|
90
|
+
$corner: list.nth($args, 1);
|
|
91
|
+
$value: list.nth($args, 2);
|
|
92
|
+
@if list.index($list, $corner) {
|
|
93
|
+
$problem: -radii-problem($value, 2);
|
|
94
|
+
@if $problem {
|
|
95
|
+
@error "`#{meta.inspect($value)}` is not a valid radius for `border-radius`: #{$problem}. A browser drops the declaration.";
|
|
96
|
+
}
|
|
97
|
+
@if $corner == "top" {
|
|
98
|
+
border-top-left-radius: $value;
|
|
99
|
+
border-top-right-radius: $value;
|
|
100
|
+
} @else if $corner == "top-right" {
|
|
101
|
+
border-top-right-radius: $value;
|
|
102
|
+
} @else if $corner == "right" {
|
|
103
|
+
border-top-right-radius: $value;
|
|
104
|
+
border-bottom-right-radius: $value;
|
|
105
|
+
} @else if $corner == "bottom-right" {
|
|
106
|
+
border-bottom-right-radius: $value;
|
|
107
|
+
} @else if $corner == "bottom" {
|
|
108
|
+
border-bottom-left-radius: $value;
|
|
109
|
+
border-bottom-right-radius: $value;
|
|
110
|
+
} @else if $corner == "bottom-left" {
|
|
111
|
+
border-bottom-left-radius: $value;
|
|
112
|
+
} @else if $corner == "left" {
|
|
113
|
+
border-top-left-radius: $value;
|
|
114
|
+
border-bottom-left-radius: $value;
|
|
115
|
+
} @else if $corner == "top-left" {
|
|
116
|
+
border-top-left-radius: $value;
|
|
117
|
+
} @else if $corner == "all" {
|
|
118
|
+
border-radius: $value;
|
|
119
|
+
} @else if $corner == "cross-left" {
|
|
120
|
+
border-top-left-radius: $value;
|
|
121
|
+
border-bottom-right-radius: $value;
|
|
122
|
+
} @else if $corner == "cross-right" {
|
|
123
|
+
border-top-right-radius: $value;
|
|
124
|
+
border-bottom-left-radius: $value;
|
|
125
|
+
} @else if $corner == "start-start" {
|
|
126
|
+
border-start-start-radius: $value;
|
|
127
|
+
} @else if $corner == "start-end" {
|
|
128
|
+
border-start-end-radius: $value;
|
|
129
|
+
} @else if $corner == "end-start" {
|
|
130
|
+
border-end-start-radius: $value;
|
|
131
|
+
} @else if $corner == "end-end" {
|
|
132
|
+
border-end-end-radius: $value;
|
|
133
|
+
} @else if $corner == "inline-start" {
|
|
134
|
+
border-start-start-radius: $value;
|
|
135
|
+
border-end-start-radius: $value;
|
|
136
|
+
} @else if $corner == "inline-end" {
|
|
137
|
+
border-start-end-radius: $value;
|
|
138
|
+
border-end-end-radius: $value;
|
|
139
|
+
} @else if $corner == "block-start" {
|
|
140
|
+
border-start-start-radius: $value;
|
|
141
|
+
border-start-end-radius: $value;
|
|
142
|
+
} @else if $corner == "block-end" {
|
|
143
|
+
border-end-start-radius: $value;
|
|
144
|
+
border-end-end-radius: $value;
|
|
145
|
+
}
|
|
146
|
+
} @else {
|
|
147
|
+
@error "Corner value must be one of the followings: #{$list}.";
|
|
148
|
+
}
|
|
149
|
+
} @else if list.length($args) == 4 {
|
|
150
|
+
@each $value in $args {
|
|
151
|
+
$problem: -radii-problem($value, 2);
|
|
152
|
+
@if $problem {
|
|
153
|
+
@error "`#{meta.inspect($value)}` is not a valid radius for `border-radius`: #{$problem}. A browser drops the declaration.";
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
$args: fillNulls($args, space, true);
|
|
157
|
+
border-top-left-radius: list.nth($args, 1);
|
|
158
|
+
border-top-right-radius: list.nth($args, 2);
|
|
159
|
+
border-bottom-right-radius: list.nth($args, 3);
|
|
160
|
+
border-bottom-left-radius: list.nth($args, 4);
|
|
161
|
+
} @else {
|
|
162
|
+
@error "`border-radius` takes 1, 2 or 4 arguments; you passed #{list.length($args)}. Use one radius for every corner, a corner name plus a radius, or four radii in top-left, top-right, bottom-right, bottom-left order.";
|
|
163
|
+
}
|
|
164
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
@charset "UTF-8";
|
|
2
|
+
|
|
3
|
+
@use "../library/stretched-link" as *;
|
|
4
|
+
@use "sass:meta";
|
|
5
|
+
@use "../internal/image-value" as *;
|
|
6
|
+
@use "../internal/length-problem" as *;
|
|
7
|
+
|
|
8
|
+
@mixin brand-logo($width, $height, $image-url: null) {
|
|
9
|
+
@each $name, $value in ("$width": $width, "$height": $height) {
|
|
10
|
+
$problem: sizeProblem($value);
|
|
11
|
+
@if $problem {
|
|
12
|
+
@error "`#{meta.inspect($value)}` is not a valid #{$name} for `brand-logo`: #{$problem}. A browser drops the declaration.";
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
display: inline-block;
|
|
16
|
+
position: relative;
|
|
17
|
+
width: $width;
|
|
18
|
+
height: $height;
|
|
19
|
+
@if $image-url {
|
|
20
|
+
background-image: imageValue($image-url, "brand-logo", "$image-url");
|
|
21
|
+
}
|
|
22
|
+
background-position: center;
|
|
23
|
+
background-repeat: no-repeat;
|
|
24
|
+
background-size: 100%;
|
|
25
|
+
a {
|
|
26
|
+
display: block;
|
|
27
|
+
width: 1px;
|
|
28
|
+
height: 1px;
|
|
29
|
+
overflow: hidden;
|
|
30
|
+
text-indent: 100%;
|
|
31
|
+
@include stretched-link(after);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
@charset "UTF-8";
|
|
2
|
+
|
|
3
|
+
@use "sass:list";
|
|
4
|
+
@use "sass:map";
|
|
5
|
+
@use "../maps/map-for-breakpoints" as *;
|
|
6
|
+
@use "../utilities/validate-breakpoint" as *;
|
|
7
|
+
@use "../internal/custom-property-in" as *;
|
|
8
|
+
@use "../internal/condition-width" as *;
|
|
9
|
+
|
|
10
|
+
// Every size goes through conditionWidth before a query is written, so a size no
|
|
11
|
+
// width condition can match raises instead of compiling into one. The queries
|
|
12
|
+
// themselves are written as they always were, and the checks in the branches
|
|
13
|
+
// below are called only for the error they raise, so a call that worked writes
|
|
14
|
+
// the same CSS.
|
|
15
|
+
@mixin breakpoint($params...) {
|
|
16
|
+
$custom-property: customPropertyIn($params);
|
|
17
|
+
@if $custom-property {
|
|
18
|
+
@error "`#{$custom-property}` cannot be used in a breakpoint: custom properties are not evaluated in a @media condition, so the rule would never apply. Pass a length or a key from $map-for-breakpoints.";
|
|
19
|
+
}
|
|
20
|
+
@if list.length($params) == 1 {
|
|
21
|
+
$value: list.nth($params, 1);
|
|
22
|
+
// Checked before the warning below, so a size that is wrong outright is
|
|
23
|
+
// refused rather than described as a single pixel.
|
|
24
|
+
$width: conditionWidth($value, "breakpoint");
|
|
25
|
+
// One argument matches a single pixel, which two agent trials took for
|
|
26
|
+
// "from this width up". Still emitted, and said out loud,
|
|
27
|
+
// but not refused: the CSS is valid and matches that one width.
|
|
28
|
+
@warn "`breakpoint(#{$value})` matches only a viewport exactly #{$width} wide, `(width: #{$width})`. Write `breakpoint(only, #{$value})` for that width, or `breakpoint(min, #{$value})` from it upwards.";
|
|
29
|
+
@if map.has-key($map-for-breakpoints, $value) {
|
|
30
|
+
@media (width: map.get($map-for-breakpoints, $value)) {
|
|
31
|
+
@content;
|
|
32
|
+
}
|
|
33
|
+
} @else {
|
|
34
|
+
@media (width: $value) {
|
|
35
|
+
@content;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
} @else if list.length($params) == 2 {
|
|
39
|
+
@if not list.index("only" "min" "max" "between", list.nth($params, 1)) {
|
|
40
|
+
$start: list.nth($params, 1);
|
|
41
|
+
$end: list.nth($params, 2);
|
|
42
|
+
$checked: conditionWidth($start, "breakpoint") conditionWidth($end, "breakpoint");
|
|
43
|
+
@media (min-width: #{validateBreakpoint($start)}) and (max-width: #{if(map.has-key($map-for-breakpoints, $end), validateBreakpoint($end) - 1, $end)}) {
|
|
44
|
+
@content;
|
|
45
|
+
}
|
|
46
|
+
} @else {
|
|
47
|
+
$mode: list.nth($params, 1);
|
|
48
|
+
$value: list.nth($params, 2);
|
|
49
|
+
@if $mode != "between" {
|
|
50
|
+
$checked: conditionWidth($value, "breakpoint");
|
|
51
|
+
}
|
|
52
|
+
@if $mode == "only" {
|
|
53
|
+
@if map.has-key($map-for-breakpoints, $value) {
|
|
54
|
+
@media (width: map.get($map-for-breakpoints, $value)) {
|
|
55
|
+
@content;
|
|
56
|
+
}
|
|
57
|
+
} @else {
|
|
58
|
+
@media (width: $value) {
|
|
59
|
+
@content;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
} @else if $mode == "min" {
|
|
63
|
+
@if map.has-key($map-for-breakpoints, $value) {
|
|
64
|
+
@media (min-width: map.get($map-for-breakpoints, $value)) {
|
|
65
|
+
@content;
|
|
66
|
+
}
|
|
67
|
+
} @else {
|
|
68
|
+
@media (min-width: $value) {
|
|
69
|
+
@content;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
} @else if $mode == "max" {
|
|
73
|
+
@if map.has-key($map-for-breakpoints, $value) {
|
|
74
|
+
@media (max-width: map.get($map-for-breakpoints, $value)) {
|
|
75
|
+
@content;
|
|
76
|
+
}
|
|
77
|
+
} @else {
|
|
78
|
+
@media (max-width: $value) {
|
|
79
|
+
@content;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
} @else if $mode == "between" {
|
|
83
|
+
$start: list.nth($value, 1);
|
|
84
|
+
$end: list.nth($value, 2);
|
|
85
|
+
$checked: conditionWidth($start, "breakpoint") conditionWidth($end, "breakpoint");
|
|
86
|
+
@media (min-width: #{validateBreakpoint($start)}) and (max-width: #{if(map.has-key($map-for-breakpoints, $end), validateBreakpoint($end) - 1, $end)}) {
|
|
87
|
+
@content;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
} @else {
|
|
92
|
+
// Anything else used to match no branch and emit nothing, so a three
|
|
93
|
+
// argument range such as `between, medium, large` failed without a sound.
|
|
94
|
+
@error "`breakpoint` takes one or two arguments; you passed #{list.length($params)}. For a range, pass `between` with a space-separated pair, `between, medium large`, or two sizes, `medium, large`.";
|
|
95
|
+
}
|
|
96
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
@charset "UTF-8";
|
|
2
|
+
|
|
3
|
+
@use "sass:meta";
|
|
4
|
+
@use "../maps/map-for-breakpoints" as *;
|
|
5
|
+
|
|
6
|
+
@mixin breakpointer($selector: null) {
|
|
7
|
+
@if $selector != null and meta.type-of($selector) != "string" {
|
|
8
|
+
@error "`#{$selector}` is not a valid $selector for `breakpointer`. Pass a selector as a string, such as `\".debug\"`, or no argument at all to attach it to body.";
|
|
9
|
+
}
|
|
10
|
+
@if & {
|
|
11
|
+
&::before {
|
|
12
|
+
@content;
|
|
13
|
+
@each $key, $value in $map-for-breakpoints {
|
|
14
|
+
@media (min-width: #{$value}) {
|
|
15
|
+
content: "#{$key}";
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
} @else {
|
|
20
|
+
@if $selector {
|
|
21
|
+
#{$selector}::before {
|
|
22
|
+
@content;
|
|
23
|
+
@each $key, $value in $map-for-breakpoints {
|
|
24
|
+
@media (min-width: #{$value}) {
|
|
25
|
+
content: "#{$key}";
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
} @else {
|
|
30
|
+
body::before {
|
|
31
|
+
@content;
|
|
32
|
+
@each $key, $value in $map-for-breakpoints {
|
|
33
|
+
@media (min-width: #{$value}) {
|
|
34
|
+
content: "#{$key}";
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
@charset "UTF-8";
|
|
2
|
+
|
|
3
|
+
@use "sass:list";
|
|
4
|
+
|
|
5
|
+
@mixin center($axis: "both") {
|
|
6
|
+
@if not list.index("both" "horizontal" "vertical", $axis) {
|
|
7
|
+
@error "`#{$axis}` is not a valid $axis for `center`. Pass one of: both, horizontal, vertical.";
|
|
8
|
+
}
|
|
9
|
+
@if $axis == "both" or $axis == "vertical" {
|
|
10
|
+
top: 50%;
|
|
11
|
+
}
|
|
12
|
+
@if $axis == "both" or $axis == "horizontal" {
|
|
13
|
+
left: 50%;
|
|
14
|
+
}
|
|
15
|
+
transform:
|
|
16
|
+
if($axis == "horizontal", translateX(-50%), if($axis == "both", translateX(-50%), null))
|
|
17
|
+
if($axis == "vertical", translateY(-50%), if($axis == "both", translateY(-50%), null))
|
|
18
|
+
;
|
|
19
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
@charset "UTF-8";
|
|
2
|
+
|
|
3
|
+
@use "sass:meta";
|
|
4
|
+
@use "../internal/length-problem" as *;
|
|
5
|
+
|
|
6
|
+
@mixin circle($size) {
|
|
7
|
+
$problem: sizeProblem($size);
|
|
8
|
+
@if $problem {
|
|
9
|
+
@error "`#{meta.inspect($size)}` is not a valid $size for `circle`: #{$problem}. A browser drops the width and height.";
|
|
10
|
+
}
|
|
11
|
+
width: $size;
|
|
12
|
+
height: $size;
|
|
13
|
+
display: inline-block;
|
|
14
|
+
border-radius: 100%;
|
|
15
|
+
}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
@charset "UTF-8";
|
|
2
|
+
|
|
3
|
+
@use "sass:list";
|
|
4
|
+
@use "sass:math";
|
|
5
|
+
@use "sass:meta";
|
|
6
|
+
@use "sass:string";
|
|
7
|
+
@use "../library/border-box" as *;
|
|
8
|
+
@use "../utilities/is-gutter" as *;
|
|
9
|
+
@use "../internal/length-problem" as *;
|
|
10
|
+
|
|
11
|
+
// The count divides 100% in calc(), which in Chrome 152 kept a unitless number
|
|
12
|
+
// and a function that resolves to one, var(), env() or attr(), or maths with
|
|
13
|
+
// one of those inside. It dropped a count with a unit, a word and maths on
|
|
14
|
+
// lengths alone, such as calc(100% - 10px): 100% divided by a length is not a
|
|
15
|
+
// length.
|
|
16
|
+
@function -count-problem($columns) {
|
|
17
|
+
@if meta.type-of($columns) == "number" {
|
|
18
|
+
@if math.is-unitless($columns) {
|
|
19
|
+
@return null;
|
|
20
|
+
}
|
|
21
|
+
@return "a column count has no unit";
|
|
22
|
+
}
|
|
23
|
+
// Interpolation, as in `#{$cols}`, gives the number as an unquoted string,
|
|
24
|
+
// which is written into calc() as it reads.
|
|
25
|
+
@if meta.type-of($columns) == "string" and string.slice(meta.inspect($columns), 1, 1) != "\"" and not string.index($columns, "(") {
|
|
26
|
+
$digits: 0;
|
|
27
|
+
@for $i from 1 through string.length($columns) {
|
|
28
|
+
$character: string.slice($columns, $i, $i);
|
|
29
|
+
@if string.index("0123456789", $character) {
|
|
30
|
+
$digits: $digits + 1;
|
|
31
|
+
} @else if not string.index(".+-", $character) {
|
|
32
|
+
@return "it is not a column count";
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
@if $digits > 0 {
|
|
36
|
+
@return null;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
@if meta.type-of($columns) == "calculation" or (meta.type-of($columns) == "string" and string.index($columns, "(")) {
|
|
40
|
+
$text: string.to-lower-case(meta.inspect($columns));
|
|
41
|
+
@if string.index($text, "var(") or string.index($text, "env(") or string.index($text, "attr(") {
|
|
42
|
+
@return null;
|
|
43
|
+
}
|
|
44
|
+
@return "maths on lengths does not give a count; pass a number, or var(), env() or attr()";
|
|
45
|
+
}
|
|
46
|
+
@return "it is not a column count";
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// The gutter is multiplied in calc() and written as a margin. Chrome 152 kept a
|
|
50
|
+
// length, a percentage and a negative length, and dropped the flex-basis for a
|
|
51
|
+
// unitless number, a unit that is not a length and a word. A unitless 0 made
|
|
52
|
+
// `(3 - 1) * 0`, a number rather than a length, so it is written as 0px.
|
|
53
|
+
@function -gutter($gutter) {
|
|
54
|
+
$problem: lengthProblem($gutter);
|
|
55
|
+
@if $problem {
|
|
56
|
+
@error "`#{meta.inspect($gutter)}` is not a valid gutter for `columnizer`: #{$problem}. A browser drops the column width.";
|
|
57
|
+
}
|
|
58
|
+
@if (meta.type-of($gutter) == "number" and math.is-unitless($gutter)) or (meta.type-of($gutter) == "string" and string.unquote($gutter) == string.unquote("0")) {
|
|
59
|
+
@return 0px;
|
|
60
|
+
}
|
|
61
|
+
@return $gutter;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
@mixin columnizer($params...) {
|
|
65
|
+
@if list.length($params) < 1 or list.length($params) > 3 {
|
|
66
|
+
@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.";
|
|
67
|
+
}
|
|
68
|
+
$columns: list.nth($params, 1);
|
|
69
|
+
$count-problem: -count-problem($columns);
|
|
70
|
+
@if $count-problem {
|
|
71
|
+
@error "`#{meta.inspect($columns)}` is not a valid column count for `columnizer`: #{$count-problem}. A browser drops the column width.";
|
|
72
|
+
}
|
|
73
|
+
$gutter: null;
|
|
74
|
+
$fill: false;
|
|
75
|
+
display: flex;
|
|
76
|
+
flex-wrap: wrap;
|
|
77
|
+
@include border-box;
|
|
78
|
+
> * {
|
|
79
|
+
@if list.length($params) == 1 {
|
|
80
|
+
flex: 0 0 calc(100% / #{$columns});
|
|
81
|
+
margin-bottom: 0;
|
|
82
|
+
&:not(:last-child) {
|
|
83
|
+
margin-right: 0;
|
|
84
|
+
}
|
|
85
|
+
} @else if list.length($params) == 2 {
|
|
86
|
+
@if meta.type-of(list.nth($params, 2)) == bool {
|
|
87
|
+
$fill: list.nth($params, list.length($params));
|
|
88
|
+
flex-grow: #{if($fill == true, 1, 0)};
|
|
89
|
+
flex-shrink: 0;
|
|
90
|
+
flex-basis: calc(100% / #{$columns});
|
|
91
|
+
margin-bottom: 0;
|
|
92
|
+
&:not(:last-child) {
|
|
93
|
+
margin-right: 0;
|
|
94
|
+
}
|
|
95
|
+
} @else if isGutter(list.nth($params, 2)) {
|
|
96
|
+
$gutter: -gutter(list.nth($params, list.length($params)));
|
|
97
|
+
flex-grow: 0;
|
|
98
|
+
flex-shrink: 0;
|
|
99
|
+
flex-basis: calc((100% - (#{$columns} - 1) * #{$gutter}) / #{$columns});
|
|
100
|
+
margin-bottom: $gutter;
|
|
101
|
+
&:not(:last-child) {
|
|
102
|
+
margin-right: $gutter;
|
|
103
|
+
}
|
|
104
|
+
&:nth-child(#{$columns}n) {
|
|
105
|
+
margin-right: 0;
|
|
106
|
+
}
|
|
107
|
+
} @else {
|
|
108
|
+
@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.";
|
|
109
|
+
}
|
|
110
|
+
} @else if list.length($params) == 3 {
|
|
111
|
+
$gutter: -gutter(list.nth($params, 2));
|
|
112
|
+
$fill: list.nth($params, list.length($params));
|
|
113
|
+
flex-grow: if($fill == true, 1, 0);
|
|
114
|
+
flex-shrink: 0;
|
|
115
|
+
flex-basis: calc((100% - (#{$columns} - 1) * #{$gutter}) / #{$columns});
|
|
116
|
+
margin-bottom: $gutter;
|
|
117
|
+
&:not(:last-child) {
|
|
118
|
+
margin-right: $gutter;
|
|
119
|
+
}
|
|
120
|
+
&:nth-child(#{$columns}n) {
|
|
121
|
+
margin-right: 0;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|