gerillass 1.6.2 → 2.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.
- package/README.md +20 -4
- package/SKILL.md +30 -32
- package/gerillass.json +188 -196
- package/package.json +2 -12
- package/scss/_gerillass.scss +8 -92
- package/scss/library/_adaptive.scss +4 -1
- package/scss/library/_after.scss +5 -2
- package/scss/library/_all-buttons.scss +6 -2
- package/scss/library/_all-text-inputs.scss +6 -2
- package/scss/library/_aspect-ratio.scss +27 -0
- package/scss/library/_background-dots.scss +12 -7
- package/scss/library/_background-image.scss +18 -11
- package/scss/library/_background-stripes.scss +14 -9
- package/scss/library/_before.scss +5 -2
- package/scss/library/_border-radius.scss +19 -15
- package/scss/library/_brand-logo.scss +3 -1
- package/scss/library/_breakpoint.scss +25 -20
- package/scss/library/_breakpointer.scss +4 -1
- package/scss/library/_center.scss +3 -1
- package/scss/library/_columnizer.scss +18 -13
- package/scss/library/_counter.scss +21 -18
- package/scss/library/_escape-to-parent.scss +3 -1
- package/scss/library/_except.scss +12 -8
- package/scss/library/_font-face.scss +17 -12
- package/scss/library/_index.scss +52 -0
- package/scss/library/_linear-gradient.scss +13 -7
- package/scss/library/_loadify.scss +15 -11
- package/scss/library/_only.scss +12 -8
- package/scss/library/_position.scss +10 -6
- package/scss/library/_radial-gradient.scss +15 -9
- package/scss/library/_remove.scss +17 -14
- package/scss/library/_reset-figure.scss +3 -1
- package/scss/library/_scissors.scss +24 -21
- package/scss/library/_smartphone.scss +10 -6
- package/scss/library/_sprite.scss +16 -12
- package/scss/library/_stretched-link.scss +3 -1
- package/scss/library/_tablet.scss +10 -6
- package/scss/library/_text-gradient.scss +13 -7
- package/scss/library/_text-shadow.scss +46 -40
- package/scss/library/_triangle.scss +15 -10
- package/scss/lists/_index.scss +8 -0
- package/scss/maps/_index.scss +8 -0
- package/scss/utilities/_clear-unit.scss +3 -1
- package/scss/utilities/_clear-whitespace.scss +9 -6
- package/scss/utilities/_convert-to-em.scss +5 -2
- package/scss/utilities/_convert-to-number.scss +10 -6
- package/scss/utilities/_fill-nulls.scss +18 -0
- package/scss/utilities/_font-sizer.scss +1 -1
- package/scss/utilities/_font-source.scss +15 -10
- package/scss/utilities/_index.scss +24 -0
- package/scss/utilities/_is-color.scss +8 -5
- package/scss/utilities/_is-gutter.scss +8 -5
- package/scss/utilities/_is-number.scss +4 -2
- package/scss/utilities/_is-time.scss +8 -3
- package/scss/utilities/_map-deep-get.scss +4 -2
- package/scss/utilities/_pixelify.scss +11 -7
- package/scss/utilities/_pseudo-selector.scss +4 -2
- package/scss/utilities/_remify.scss +3 -1
- package/scss/utilities/_shade.scss +10 -0
- package/scss/utilities/_shorthand-property.scss +13 -11
- package/scss/utilities/_tint.scss +10 -0
- package/scss/utilities/_validate-breakpoint.scss +9 -5
- package/scss/utilities/_validate-length.scss +10 -5
- package/scss/utilities/_validate-ratio.scss +27 -15
- package/scss/utilities/_validate-scissors.scss +16 -11
- package/scss/_gerillass-prefix.scss +0 -1586
- package/scss/library/_ratio-box.scss +0 -19
- package/scss/library/_responsive-video.scss +0 -19
- package/scss/utilities/_darken.scss +0 -7
- package/scss/utilities/_lighten.scss +0 -7
- package/scss/utilities/_null.scss +0 -16
package/README.md
CHANGED
|
@@ -32,7 +32,7 @@ Hope you’ll enjoy using it!
|
|
|
32
32
|
- [Cloning the Repository from Github](#cloning-the-repository-from-github)
|
|
33
33
|
- [Versions these examples were tested with](#versions-these-examples-were-tested-with)
|
|
34
34
|
- [Using Gerillass with an AI coding agent](#using-gerillass-with-an-ai-coding-agent)
|
|
35
|
-
- [
|
|
35
|
+
- [Three ways to call the same mixin](#three-ways-to-call-the-same-mixin)
|
|
36
36
|
- [Vendor Prefix Support](#vendor-prefix-support)
|
|
37
37
|
- [Experimenting](#experimenting)
|
|
38
38
|
- [Testing](#testing)
|
|
@@ -79,7 +79,6 @@ Pointing straight at the file always works too:
|
|
|
79
79
|
|
|
80
80
|
The per-tool recipes below were each verified against a real build of Gerillass v1.5.0. The versions used are listed at the end of this section.
|
|
81
81
|
|
|
82
|
-
> **A note on eyeglass.** Gerillass still ships eyeglass module metadata, but eyeglass has not been released since June 2022 and its importer is broken with current Dart Sass — any `@import` fails with `doneImporting is not a function`, whether Gerillass is involved or not. It also relies on the legacy JS API, which Dart Sass removes in 2.0.0. Use the `pkg:` importer above instead; it is the built-in equivalent.
|
|
83
82
|
|
|
84
83
|
### Using with Vite
|
|
85
84
|
|
|
@@ -205,9 +204,26 @@ Otherwise, point your agent at the file and it will read it as plain Markdown.
|
|
|
205
204
|
Neither file is generated by hand: signatures are parsed from the Sass sources, and every example and refusal in the manifest is executed by the test suite. What the manifest says the library does is what the library does.
|
|
206
205
|
|
|
207
206
|
|
|
208
|
-
##
|
|
207
|
+
## Three ways to call the same mixin
|
|
209
208
|
|
|
210
|
-
|
|
209
|
+
None of them is required — pick whichever reads best in your project, and stay with it in a given file.
|
|
210
|
+
|
|
211
|
+
**Bare.** The shortest, and fine unless another library defines the same name.
|
|
212
|
+
|
|
213
|
+
@use 'gerillass' as *;
|
|
214
|
+
.avatar { @include circle(50px); }
|
|
215
|
+
|
|
216
|
+
**With the `gls-` prefix.** Every mixin also answers to a prefixed name, which avoids collisions with Bootstrap and friends.
|
|
217
|
+
|
|
218
|
+
@use 'gerillass' as *;
|
|
219
|
+
.avatar { @include gls-circle(50px); }
|
|
220
|
+
|
|
221
|
+
**Through a namespace.** Sass's own mechanism, and the tidiest of the three: nothing enters your global scope at all, so a collision is impossible. The name after `as` is yours to choose.
|
|
222
|
+
|
|
223
|
+
@use 'gerillass' as gls;
|
|
224
|
+
.avatar { @include gls.circle(50px); }
|
|
225
|
+
|
|
226
|
+
All three produce identical CSS. The prefix predates the Sass module system; if you are starting fresh, the namespace does the same job without the extra name.
|
|
211
227
|
|
|
212
228
|
## Vendor Prefix Support
|
|
213
229
|
|
package/SKILL.md
CHANGED
|
@@ -5,7 +5,7 @@ description: Use the Gerillass Sass mixin library — loading it, the mixin cata
|
|
|
5
5
|
|
|
6
6
|
# Gerillass
|
|
7
7
|
|
|
8
|
-
A Sass mixin library:
|
|
8
|
+
A Sass mixin library: 50 mixins and 22 functions that emit CSS from
|
|
9
9
|
semantic declarations. It is Sass source only — there is no runtime and no
|
|
10
10
|
utility classes, so styles live in your stylesheet and your markup stays clean.
|
|
11
11
|
|
|
@@ -37,7 +37,7 @@ Dart Sass only. LibSass and node-sass are not supported.
|
|
|
37
37
|
|
|
38
38
|
## Two names for every mixin
|
|
39
39
|
|
|
40
|
-
Every mixin exists twice: bare (`
|
|
40
|
+
Every mixin exists twice: bare (`circle`) and prefixed (`gls-circle`).
|
|
41
41
|
They are the same mixin. The prefix exists to avoid collisions with other
|
|
42
42
|
libraries. Pick one and stay with it; do not mix them in a file.
|
|
43
43
|
|
|
@@ -45,17 +45,17 @@ With the module system you can namespace instead, which is usually cleaner:
|
|
|
45
45
|
|
|
46
46
|
```scss
|
|
47
47
|
@use "gerillass" as gls;
|
|
48
|
-
.
|
|
48
|
+
.avatar { @include gls.circle(50px); }
|
|
49
49
|
```
|
|
50
50
|
|
|
51
51
|
## Getting arguments right
|
|
52
52
|
|
|
53
53
|
The conventions are not uniform across the library, so check before guessing.
|
|
54
|
-
|
|
54
|
+
A mixin that wants a string will not take a bare value:
|
|
55
55
|
|
|
56
56
|
```scss
|
|
57
|
-
.
|
|
58
|
-
.
|
|
57
|
+
.a { @include after(42) { color: red; } } // wrong — errors
|
|
58
|
+
.a { @include after("→") { color: red; } } // right
|
|
59
59
|
```
|
|
60
60
|
|
|
61
61
|
Mixins that reject bad input do so with a message naming what they accept. If
|
|
@@ -69,6 +69,7 @@ a dropped declaration rather than an error.
|
|
|
69
69
|
| `all-buttons` | `@include all-buttons(nonsense) { color: red; }` |
|
|
70
70
|
| `all-text-inputs` | `@include all-text-inputs(nonsense) { color: red; }` |
|
|
71
71
|
| `antialias` | `@include antialias(only);` |
|
|
72
|
+
| `aspect-ratio` | `.thumb { @include aspect-ratio("16:9", nonsense); }` |
|
|
72
73
|
| `background-dots` | `.a { @include background-dots(red, 1em, 5em, maybe); }` |
|
|
73
74
|
| `background-image` | `.a { @include background-image("/img/a.png", (red, blue), sideways); }` |
|
|
74
75
|
| `background-stripes` | `.a { @include background-stripes(red, 2em, nonsense); }` |
|
|
@@ -86,10 +87,8 @@ a dropped declaration rather than an error.
|
|
|
86
87
|
| `loadify` | `@include loadify(nonsense);` |
|
|
87
88
|
| `only` | `.a { @include only(#ff0000) { margin: 0; } }` |
|
|
88
89
|
| `radial-gradient` | `.a { @include radial-gradient(42, "center", (red, blue)); }` |
|
|
89
|
-
| `ratio-box` | `.hero { @include ratio-box(16 9); }` |
|
|
90
90
|
| `remove` | `.a { @include remove(a, b, c); }` |
|
|
91
91
|
| `reset-css` | `.a { @include reset-css; }` |
|
|
92
|
-
| `responsive-video` | `.video { @include responsive-video(16 9); }` |
|
|
93
92
|
| `scissors` | `.a { @include scissors(5px 10px); }` |
|
|
94
93
|
| `smartphone` | `.a { @include smartphone(Nokia3310) { display: none; } }` |
|
|
95
94
|
| `sprite` | `.icon { @include sprite("/img/sprite.txt"); }` |
|
|
@@ -109,6 +108,7 @@ a dropped declaration rather than an error.
|
|
|
109
108
|
| `all-buttons($pseudo: null)` | Targets every button-like element at once, optionally in one pseudo-class state. |
|
|
110
109
|
| `all-text-inputs($pseudo: null)` | Targets every text-like input at once, optionally in one pseudo-class state. |
|
|
111
110
|
| `antialias($value: null)` | Turns on subpixel-antialiased text smoothing. |
|
|
111
|
+
| `aspect-ratio($ratio: null, $fit: cover)` | Holds an element to a ratio and adds what CSS aspect-ratio alone leaves out: object-fit so an image is cropped rather than stretched, and border: 0 so an iframe does not overflow its container by 4px. Apply it to the element itself, not to a wrapper. |
|
|
112
112
|
| `background-dots($color: null, $size: 1em, $gutter: $size * 5, $diagonal: true, $image: null)` | Repeating dot pattern as a background, optionally over an image. |
|
|
113
113
|
| `background-image($image-url: null, $filter-color: null, $filter-direction: null)` | Background image with an optional colour or gradient filter laid over it. |
|
|
114
114
|
| `background-stripes($color: null, $thickness: 1em, $rotation: -45deg, $image: null)` | Repeating stripe pattern as a background, optionally over an image. |
|
|
@@ -135,13 +135,11 @@ a dropped declaration rather than an error.
|
|
|
135
135
|
| `placeholder` | Styles the placeholder text of an input across vendor prefixes. |
|
|
136
136
|
| `position($position: absolute, $offsets: 0)` | Sets position and offsets in one call, using shorthand order. |
|
|
137
137
|
| `radial-gradient($shape, $position, $colors)` | Radial gradient background from a shape and a position. |
|
|
138
|
-
| `ratio-box($ratio: null)` | Container that holds a fixed aspect ratio. Its single direct child is stretched to fill it. |
|
|
139
138
|
| `remove($params...)` | Hides an element outright, or only within a breakpoint range. |
|
|
140
139
|
| `reset-css` | Meyer reset. Must be called at the root of the stylesheet. |
|
|
141
140
|
| `reset-figure` | Removes default figure margins and makes the image inside responsive. |
|
|
142
141
|
| `resizable($direction: both, $overflow: auto)` | Makes an element user-resizable. |
|
|
143
142
|
| `responsive-image` | Makes an image fill its container width. |
|
|
144
|
-
| `responsive-video($ratio: null)` | Wrapper that keeps an embedded video at a fixed aspect ratio. |
|
|
145
143
|
| `scissors($corners)` | Cuts the corners off an element with clip-path. |
|
|
146
144
|
| `screen-agent($resolution)` | Media query targeting a screen pixel density. |
|
|
147
145
|
| `sizer($width, $height: $width)` | Sets width and height together; one argument makes a square. |
|
|
@@ -163,28 +161,28 @@ functions rather than mixins; they are public API.
|
|
|
163
161
|
|
|
164
162
|
| Signature | What it does |
|
|
165
163
|
|---|---|
|
|
166
|
-
| `
|
|
167
|
-
| `
|
|
168
|
-
| `
|
|
169
|
-
| `
|
|
170
|
-
| `
|
|
171
|
-
| `
|
|
172
|
-
| `
|
|
173
|
-
| `
|
|
174
|
-
| `
|
|
175
|
-
| `
|
|
176
|
-
| `
|
|
177
|
-
| `
|
|
178
|
-
| `
|
|
179
|
-
| `
|
|
180
|
-
| `
|
|
181
|
-
| `
|
|
182
|
-
| `
|
|
183
|
-
| `
|
|
184
|
-
| `
|
|
185
|
-
| `
|
|
186
|
-
| `
|
|
187
|
-
| `
|
|
164
|
+
| `clearUnit($value)` | Strips the unit off a number, returning it unitless. |
|
|
165
|
+
| `clearWhitespace($string)` | Removes every space from a string. |
|
|
166
|
+
| `convertToEm($value)` | Converts a pixel length to em, against a 16px base. |
|
|
167
|
+
| `convertToNumber($value)` | Parses a string of digits into a number. |
|
|
168
|
+
| `fillNulls($value, $seperation: comma, $skip: false)` | Replaces null entries in a list with 0, or drops them. |
|
|
169
|
+
| `fontSizer($size, $time)` | Multiplies a size by a factor. Handy for a modular scale. |
|
|
170
|
+
| `fontSource($font-family, $file-path, $file-formats)` | Builds one src entry for an @font-face rule. |
|
|
171
|
+
| `isColor($value)` | Returns the value if every item in it is a colour, and errors otherwise. |
|
|
172
|
+
| `isGutter($value)` | True for anything that can sit where a CSS length is expected: a number, a calculation, or a CSS function such as var(). |
|
|
173
|
+
| `isNumber($value)` | Returns the value if it is a number. |
|
|
174
|
+
| `isTime($value)` | Returns the value if it is a time in s or ms, and errors otherwise. |
|
|
175
|
+
| `mapDeepGet($map, $keys...)` | Reads a value out of a nested map by following a chain of keys. |
|
|
176
|
+
| `pixelify($value)` | Returns the value with a px unit, adding one if it is missing. |
|
|
177
|
+
| `pseudoSelector($elements, $pseudo: null)` | Appends a pseudo-class to every selector in a list. |
|
|
178
|
+
| `remify($value)` | Converts a pixel length to rem, against a 16px root. |
|
|
179
|
+
| `shade($color, $percentage)` | Mixes a colour towards black by a percentage. |
|
|
180
|
+
| `shorthandProperty($value)` | Expands one to four values into the four-value CSS shorthand order. |
|
|
181
|
+
| `tint($color, $percentage)` | Mixes a colour towards white by a percentage. |
|
|
182
|
+
| `validateBreakpoint($value)` | Resolves a breakpoint name to its width, passing other values through. |
|
|
183
|
+
| `validateLength($value)` | Returns the value if it is a length or one of auto, inherit, initial, 0. |
|
|
184
|
+
| `validateRatio($ratio)` | Turns an aspect ratio into a value for the CSS aspect-ratio property. |
|
|
185
|
+
| `validateScissors($value)` | Normalises corner values for the scissors mixin, adding px where missing. |
|
|
188
186
|
|
|
189
187
|
## Checking your work
|
|
190
188
|
|