gerillass 2.1.0 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -0
- package/SKILL.md +57 -5
- package/gerillass.json +315 -66
- package/package.json +1 -1
- package/scss/library/_after.scss +15 -0
- package/scss/library/_all-text-inputs.scss +1 -1
- package/scss/library/_background-dots.scss +55 -9
- package/scss/library/_background-image.scss +31 -5
- package/scss/library/_background-stripes.scss +43 -4
- package/scss/library/_before.scss +15 -0
- package/scss/library/_border-radius.scss +25 -1
- package/scss/library/_brand-logo.scss +24 -1
- package/scss/library/_breakpoint.scss +34 -0
- package/scss/library/_container-query.scss +73 -1
- package/scss/library/_counter.scss +24 -2
- package/scss/library/_focus-ring.scss +34 -0
- package/scss/library/_font-face.scss +61 -3
- package/scss/library/_index.scss +3 -0
- package/scss/library/_line-clamp.scss +14 -1
- package/scss/library/_loadify.scss +7 -0
- package/scss/library/_motion-safe.scss +28 -0
- package/scss/library/_remove.scss +4 -1
- package/scss/library/_reset-css.scss +7 -5
- package/scss/library/_screen-agent.scss +27 -0
- package/scss/library/_text-image.scss +24 -1
- package/scss/library/_tokens.scss +111 -0
- package/scss/library/_triangle.scss +109 -9
- package/scss/utilities/_clear-unit.scss +4 -0
- package/scss/utilities/_convert-to-em.scss +6 -0
- package/scss/utilities/_convert-to-number.scss +15 -0
- package/scss/utilities/_font-sizer.scss +14 -0
- package/scss/utilities/_remify.scss +7 -0
- package/scss/utilities/_validate-length.scss +7 -0
- package/scss/utilities/_validate-ratio.scss +25 -2
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
@charset "UTF-8";
|
|
2
2
|
|
|
3
3
|
@use "sass:math";
|
|
4
|
+
@use "sass:meta";
|
|
4
5
|
|
|
5
6
|
@function remify($value) {
|
|
7
|
+
// Only a pixel length converts cleanly. Anything else used to reach the
|
|
8
|
+
// arithmetic unchecked: a word failed with Sass's own "Undefined operation",
|
|
9
|
+
// and a unitless number or another unit compiled to `calc(1.5rem / 1px)`.
|
|
10
|
+
@if meta.type-of($value) != "number" or math.unit($value) != "px" {
|
|
11
|
+
@error "`#{meta.inspect($value)}` is not a valid $value for `remify`. Pass a pixel length, such as `24px`.";
|
|
12
|
+
}
|
|
6
13
|
$base-value: 16px;
|
|
7
14
|
$rem-value: math.div($value, $base-value);
|
|
8
15
|
@return $rem-value * 1rem;
|
|
@@ -6,6 +6,13 @@
|
|
|
6
6
|
@use "sass:string";
|
|
7
7
|
|
|
8
8
|
@function validateLength($value) {
|
|
9
|
+
// null means "leave this out": `position` skips an edge given null, as its
|
|
10
|
+
// documentation shows. It is not a mistake to warn about, and the warning
|
|
11
|
+
// printed empty backticks, because null interpolates to nothing.
|
|
12
|
+
@if $value == null {
|
|
13
|
+
@return null;
|
|
14
|
+
}
|
|
15
|
+
|
|
9
16
|
$keywords: ("auto", "inherit", "initial", "unset", "revert", 0);
|
|
10
17
|
|
|
11
18
|
@if list.index($keywords, $value) {
|
|
@@ -28,6 +28,13 @@
|
|
|
28
28
|
@return $ratio;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
+
// var() is resolved by the browser. Checked inline rather than through a
|
|
32
|
+
// helper function, which tools/build-manifest.js would take for this file's
|
|
33
|
+
// member in place of validateRatio.
|
|
34
|
+
@if meta.type-of($ratio) == "string" and string.slice(meta.inspect($ratio), 1, 1) != "\"" and string.index(string.to-lower-case($ratio), "var(") == 1 {
|
|
35
|
+
@return $ratio;
|
|
36
|
+
}
|
|
37
|
+
|
|
31
38
|
@if meta.type-of($ratio) == "string" {
|
|
32
39
|
$separator: null;
|
|
33
40
|
@if string.index($ratio, "/") {
|
|
@@ -38,8 +45,24 @@
|
|
|
38
45
|
@error "`#{$ratio}` is not a valid ratio. A string ratio must separate width and height with `/` or `:`, like `\"16/9\"` or `\"16:9\"`.";
|
|
39
46
|
}
|
|
40
47
|
|
|
41
|
-
$width:
|
|
42
|
-
$height:
|
|
48
|
+
$width-text: string.slice($ratio, 1, $separator - 1);
|
|
49
|
+
$height-text: string.slice($ratio, $separator + 1);
|
|
50
|
+
|
|
51
|
+
// Checked here so a malformed ratio is reported as a ratio, rather than as
|
|
52
|
+
// a bad argument to convertToNumber, which the caller never called.
|
|
53
|
+
@each $part in ($width-text, $height-text) {
|
|
54
|
+
@if string.length($part) == 0 {
|
|
55
|
+
@error "`#{$ratio}` is not a valid ratio. Width and height must both be whole numbers, like `\"16/9\"` or `\"16:9\"`.";
|
|
56
|
+
}
|
|
57
|
+
@for $i from 1 through string.length($part) {
|
|
58
|
+
@if not list.index("0" "1" "2" "3" "4" "5" "6" "7" "8" "9", string.slice($part, $i, $i)) {
|
|
59
|
+
@error "`#{$ratio}` is not a valid ratio. Width and height must both be whole numbers, like `\"16/9\"` or `\"16:9\"`.";
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
$width: convertToNumber($width-text);
|
|
65
|
+
$height: convertToNumber($height-text);
|
|
43
66
|
|
|
44
67
|
@if $width == 0 {
|
|
45
68
|
@error "`#{$ratio}` is not a valid ratio. The width must be greater than zero.";
|