gerillass 2.2.0 → 2.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/gerillass.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gerillass",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.1",
|
|
4
4
|
"description": "Gerillass is an open-source toolkit that contains a set of Sass mixins to help designers and developers to create better, faster and consistent user interfaces.",
|
|
5
5
|
"homepage": "https://gerillass.com",
|
|
6
6
|
"documentation": "https://docs.gerillass.com",
|
|
@@ -705,7 +705,9 @@
|
|
|
705
705
|
],
|
|
706
706
|
"rejects": [
|
|
707
707
|
".card { @include container(\"card\", sideways); }",
|
|
708
|
-
".card { @include container(42); }"
|
|
708
|
+
".card { @include container(42); }",
|
|
709
|
+
".card { @include container(\"and\"); }",
|
|
710
|
+
".card { @include container(\"1card\"); }"
|
|
709
711
|
]
|
|
710
712
|
},
|
|
711
713
|
{
|
|
@@ -921,7 +923,10 @@
|
|
|
921
923
|
"@include font-face(var(--font-family), \"/fonts/inter\", $file-formats: woff2);",
|
|
922
924
|
"@include font-face(\"Inter\", \"/fonts/inter\", var(--font-style), $file-formats: woff2);",
|
|
923
925
|
"@include font-face(\"Inter\", \"/fonts/inter\", $font-weight: var(--font-weight), $file-formats: woff2);",
|
|
924
|
-
"@include font-face(\"Inter\", \"/fonts/inter\", $font-weight: 100 var(--max-weight), $file-formats: woff2);"
|
|
926
|
+
"@include font-face(\"Inter\", \"/fonts/inter\", $font-weight: 100 var(--max-weight), $file-formats: woff2);",
|
|
927
|
+
"@include font-face(sans-serif, \"/fonts/inter\", $file-formats: woff2);",
|
|
928
|
+
"@include font-face(inherit, \"/fonts/inter\", $file-formats: woff2);",
|
|
929
|
+
"@include font-face(env(--font-family), \"/fonts/inter\", $file-formats: woff2);"
|
|
925
930
|
]
|
|
926
931
|
},
|
|
927
932
|
{
|
package/package.json
CHANGED
|
@@ -4,6 +4,63 @@
|
|
|
4
4
|
@use "sass:meta";
|
|
5
5
|
@use "sass:string";
|
|
6
6
|
|
|
7
|
+
// What a browser will not keep in `container-name`. Measured in Chrome 152, the
|
|
8
|
+
// declaration was dropped for `and`, `or`, `not` and `default` in any case, a
|
|
9
|
+
// name starting with a digit or a hyphen and a digit, and a name holding `.`,
|
|
10
|
+
// `#` or `!`; and for a list with any one of those in it, such as `card and`,
|
|
11
|
+
// and for `none` or a CSS-wide keyword beside another name, such as `NONE card`
|
|
12
|
+
// or `card inherit`. `none`, `inherit`, `revert` and the other CSS-wide
|
|
13
|
+
// keywords were kept on their own, as were several valid names,
|
|
14
|
+
// `-card`, and `var()`, which a container can take its name from.
|
|
15
|
+
$-reserved-names: "and" "or" "not" "default";
|
|
16
|
+
$-alone-names: "none" "inherit" "initial" "unset" "revert" "revert-layer";
|
|
17
|
+
$-forbidden-in-name: "." "," "/" "#" ":" ";" "(" ")" "[" "]" "{" "}" "!" "@" "$" "%" "^" "&" "*" "+" "=" "<" ">" "?" "\\" "|" "~" "`" "'" "\"";
|
|
18
|
+
|
|
19
|
+
@function -words($text) {
|
|
20
|
+
$words: ();
|
|
21
|
+
$rest: $text;
|
|
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
|
+
}
|
|
36
|
+
|
|
37
|
+
@function -name-problem($name) {
|
|
38
|
+
$text: "#{$name}";
|
|
39
|
+
@if string.index($text, "var(") {
|
|
40
|
+
@return null;
|
|
41
|
+
}
|
|
42
|
+
$words: -words($text);
|
|
43
|
+
@each $word in $words {
|
|
44
|
+
$lower: string.to-lower-case($word);
|
|
45
|
+
@if list.index($-alone-names, $lower) and list.length($words) > 1 {
|
|
46
|
+
@return "`#{$word}` only works as the whole value, not beside another name";
|
|
47
|
+
}
|
|
48
|
+
@if list.index($-reserved-names, $lower) {
|
|
49
|
+
@return "`and`, `or`, `not` and `default` cannot name a container";
|
|
50
|
+
}
|
|
51
|
+
$first: string.slice($word, 1, 1);
|
|
52
|
+
@if string.index("0123456789", $first) or ($first == "-" and string.length($word) > 1 and string.index("0123456789", string.slice($word, 2, 2))) {
|
|
53
|
+
@return "a container name cannot start with a digit, or with a hyphen and a digit";
|
|
54
|
+
}
|
|
55
|
+
@each $character in $-forbidden-in-name {
|
|
56
|
+
@if string.index($word, $character) {
|
|
57
|
+
@return "a container name cannot contain `#{$character}`";
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
@return null;
|
|
62
|
+
}
|
|
63
|
+
|
|
7
64
|
// Marks an element as a query container, so `container-query` can ask about its
|
|
8
65
|
// width instead of the viewport's.
|
|
9
66
|
//
|
|
@@ -19,6 +76,12 @@
|
|
|
19
76
|
@if $name != null and meta.type-of($name) != "string" {
|
|
20
77
|
@error "`#{$name}` is not a valid $name for `container`. Pass a name as a string, such as `\"card\"`, or no name at all.";
|
|
21
78
|
}
|
|
79
|
+
@if $name != null {
|
|
80
|
+
$problem: -name-problem($name);
|
|
81
|
+
@if $problem {
|
|
82
|
+
@error "`#{$name}` is not a valid $name for `container`: #{$problem}, and a browser drops the whole declaration. Pass a name such as `\"card\"`.";
|
|
83
|
+
}
|
|
84
|
+
}
|
|
22
85
|
container-type: $type;
|
|
23
86
|
@if $name {
|
|
24
87
|
container-name: string.unquote($name);
|
|
@@ -30,6 +30,13 @@
|
|
|
30
30
|
// and a rule with no family is never used. A quoted "var(--f)" is only a
|
|
31
31
|
// name, which the browser kept, so it is left alone like a quoted path.
|
|
32
32
|
@error "`#{$font-family}` is not a valid $font-family for `font-face`. A custom property cannot supply it, because a @font-face rule drops var() in a descriptor, and without a family the font is never used. Pass the family name as a string, such as `\"Inter\"`.";
|
|
33
|
+
} @else if string.slice(meta.inspect($font-family), 1, 1) != "\"" and (list.index("serif" "sans-serif" "monospace" "cursive" "fantasy" "system-ui" "math" "inherit" "initial" "unset" "revert" "revert-layer" "default", string.to-lower-case($font-family)) or string.index($font-family, "env(") or string.index($font-family, "attr(")) {
|
|
34
|
+
// Measured in Chrome 152, a @font-face rule dropped an unquoted `serif`,
|
|
35
|
+
// `sans-serif`, `monospace`, `cursive`, `fantasy`, `system-ui`, `math`,
|
|
36
|
+
// `default` or CSS-wide keyword, in any case, and `env()` and `attr()`. The
|
|
37
|
+
// same words quoted are names and were kept, as were `emoji`, `fangsong` and
|
|
38
|
+
// the `ui-` families unquoted.
|
|
39
|
+
@error "`#{$font-family}` is not a valid $font-family for `font-face`. A @font-face rule drops a generic family, a CSS-wide keyword or a function as its family, and without a family the font is never used. Pass the family name as a quoted string, such as `\"Inter\"`.";
|
|
33
40
|
} @else {
|
|
34
41
|
|
|
35
42
|
$list: ();
|