gerillass 2.2.1 → 2.3.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/SKILL.md +2 -1
- package/gerillass.json +17 -4
- package/package.json +1 -1
- package/scss/library/_position.scss +29 -9
package/SKILL.md
CHANGED
|
@@ -92,6 +92,7 @@ a dropped declaration rather than an error.
|
|
|
92
92
|
| `loadify` | `@include loadify(nonsense);` |
|
|
93
93
|
| `motion-safe` | `.card { @include motion-safe; }` |
|
|
94
94
|
| `only` | `.a { @include only(#ff0000) { margin: 0; } }` |
|
|
95
|
+
| `position` | `.badge { @include position(absolute, 0, $logical: yes); }` |
|
|
95
96
|
| `radial-gradient` | `.a { @include radial-gradient(42, "center", (red, blue)); }` |
|
|
96
97
|
| `remove` | `.a { @include remove(a, b, c); }` |
|
|
97
98
|
| `reset-css` | `.a { @include reset-css; }` |
|
|
@@ -190,7 +191,7 @@ a dropped declaration rather than an error.
|
|
|
190
191
|
| `only($params...)` | Selects only the siblings named. |
|
|
191
192
|
| `placeholder-shown` | Styles an input while its placeholder is visible. |
|
|
192
193
|
| `placeholder` | Styles the placeholder text of an input across vendor prefixes. |
|
|
193
|
-
| `position($position: absolute, $offsets: 0)` | Sets position and offsets in one call, using shorthand order. |
|
|
194
|
+
| `position($position: absolute, $offsets: 0, $logical: false)` | Sets position and offsets in one call, using shorthand order. |
|
|
194
195
|
| `radial-gradient($shape, $position, $colors)` | Radial gradient background from a shape and a position. |
|
|
195
196
|
| `remove($params...)` | Hides an element outright, or within a media query: from a breakpoint up with min, up to it with max, or between two breakpoints. One breakpoint on its own hides the element at exactly that width, a single pixel, and prints a warning: pass only for that. |
|
|
196
197
|
| `reset-css` | Meyer reset. Must be called at the root of the stylesheet. |
|
package/gerillass.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gerillass",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
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",
|
|
@@ -1131,18 +1131,31 @@
|
|
|
1131
1131
|
"one to four lengths in shorthand order, or auto/inherit/initial/0",
|
|
1132
1132
|
"null in any position to leave that edge out"
|
|
1133
1133
|
]
|
|
1134
|
+
},
|
|
1135
|
+
{
|
|
1136
|
+
"name": "$logical",
|
|
1137
|
+
"default": "false",
|
|
1138
|
+
"accepts": [
|
|
1139
|
+
"false, the default, for top, right, bottom and left",
|
|
1140
|
+
"null, read as false",
|
|
1141
|
+
"true for inset-block-start, inset-inline-end, inset-block-end and inset-inline-start, which follow the writing direction"
|
|
1142
|
+
]
|
|
1134
1143
|
}
|
|
1135
1144
|
],
|
|
1136
1145
|
"file": "scss/library/_position.scss",
|
|
1137
|
-
"signature": "position($position: absolute, $offsets: 0)",
|
|
1146
|
+
"signature": "position($position: absolute, $offsets: 0, $logical: false)",
|
|
1138
1147
|
"summary": "Sets position and offsets in one call, using shorthand order.",
|
|
1139
1148
|
"examples": [
|
|
1140
1149
|
".a { @include position(absolute, 0); }",
|
|
1141
1150
|
".a { @include position(fixed, 0 10px); }",
|
|
1142
1151
|
".a { @include position(absolute, null 16px 16px 16px); }",
|
|
1143
|
-
".a { @include position(absolute, 0 null null 0); }"
|
|
1152
|
+
".a { @include position(absolute, 0 null null 0); }",
|
|
1153
|
+
".badge { @include position(absolute, 0 auto auto 1rem, $logical: true); }",
|
|
1154
|
+
".a { @include position(absolute, 0, $logical: null); }"
|
|
1144
1155
|
],
|
|
1145
|
-
"rejects": [
|
|
1156
|
+
"rejects": [
|
|
1157
|
+
".badge { @include position(absolute, 0, $logical: yes); }"
|
|
1158
|
+
]
|
|
1146
1159
|
},
|
|
1147
1160
|
{
|
|
1148
1161
|
"name": "radial-gradient",
|
package/package.json
CHANGED
|
@@ -1,21 +1,41 @@
|
|
|
1
1
|
@charset "UTF-8";
|
|
2
2
|
|
|
3
3
|
@use "sass:list";
|
|
4
|
+
@use "sass:meta";
|
|
4
5
|
@use "../utilities/shorthand-property" as *;
|
|
5
6
|
@use "../utilities/validate-length" as *;
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
// Sets position and its four offsets in shorthand order: top, right, bottom,
|
|
9
|
+
// left, as `margin` and `padding` take them.
|
|
10
|
+
//
|
|
11
|
+
// Pass $logical: true for the offsets that follow the writing direction, the
|
|
12
|
+
// same choice `triangle` and `border-radius` offer with their logical names.
|
|
13
|
+
// The shorthand order stays the same and each position maps to its logical
|
|
14
|
+
// twin: top to inset-block-start, right to inset-inline-end, bottom to
|
|
15
|
+
// inset-block-end, left to inset-inline-start. Measured in Chrome 152: under
|
|
16
|
+
// dir="ltr" each logical offset put the box where its physical twin did, and
|
|
17
|
+
// under dir="rtl" where the mirrored twin did, while a physical `left: 16px`
|
|
18
|
+
// stayed 16px from the left in both. For one offset, writing inset-* by hand is
|
|
19
|
+
// as short; the argument is here so the library behaves the same way
|
|
20
|
+
// everywhere.
|
|
21
|
+
@mixin position($position: absolute, $offsets: 0, $logical: false) {
|
|
22
|
+
// null is read as false, as a null argument means "not set" across the
|
|
23
|
+
// library, so a caller can pass a variable that may be unset.
|
|
24
|
+
@if $logical != true and $logical != false and $logical != null {
|
|
25
|
+
@error "`#{meta.inspect($logical)}` is not a valid $logical for `position`. Pass true for offsets that follow the writing direction, or false for top, right, bottom and left.";
|
|
26
|
+
}
|
|
27
|
+
|
|
8
28
|
$offsets: shorthandProperty($offsets);
|
|
9
|
-
$
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
);
|
|
29
|
+
$edges: top right bottom left;
|
|
30
|
+
@if $logical {
|
|
31
|
+
$edges: inset-block-start inset-inline-end inset-block-end inset-inline-start;
|
|
32
|
+
}
|
|
33
|
+
|
|
15
34
|
position: $position;
|
|
16
|
-
@
|
|
35
|
+
@for $i from 1 through 4 {
|
|
36
|
+
$value: list.nth($offsets, $i);
|
|
17
37
|
@if validateLength($value) {
|
|
18
|
-
#{$
|
|
38
|
+
#{list.nth($edges, $i)}: $value;
|
|
19
39
|
}
|
|
20
40
|
}
|
|
21
41
|
}
|