gerillass 2.1.0 → 2.1.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/README.md +23 -0
- package/SKILL.md +41 -3
- package/gerillass.json +163 -58
- package/package.json +1 -1
- package/scss/library/_after.scss +15 -0
- 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/_brand-logo.scss +24 -1
- package/scss/library/_breakpoint.scss +29 -0
- package/scss/library/_container-query.scss +23 -0
- package/scss/library/_counter.scss +24 -2
- package/scss/library/_font-face.scss +14 -0
- package/scss/library/_line-clamp.scss +14 -1
- package/scss/library/_loadify.scss +7 -0
- 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/_triangle.scss +69 -7
- 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
package/README.md
CHANGED
|
@@ -27,6 +27,7 @@ Hope you’ll enjoy using it!
|
|
|
27
27
|
- [Installation](#installation)
|
|
28
28
|
- [Using with Vite](#using-with-vite)
|
|
29
29
|
- [Using with webpack](#using-with-webpack)
|
|
30
|
+
- [Using with Parcel](#using-with-parcel)
|
|
30
31
|
- [Using with Next.js](#using-with-nextjs)
|
|
31
32
|
- [Using with Angular](#using-with-angular)
|
|
32
33
|
- [Using with Gulp](#using-with-gulp)
|
|
@@ -94,6 +95,27 @@ Vite resolves the package by name, so there is nothing to configure. This covers
|
|
|
94
95
|
|
|
95
96
|
@use 'gerillass' as *;
|
|
96
97
|
|
|
98
|
+
### Using with Parcel
|
|
99
|
+
|
|
100
|
+
Parcel resolves the package by name too, so the usual line needs no configuration:
|
|
101
|
+
|
|
102
|
+
@use 'gerillass' as *;
|
|
103
|
+
|
|
104
|
+
**Remove `main` from your project's own `package.json`.** `npm init -y` writes `"main": "index.js"`, and Parcel reads that field as a library build target. With it present an app build fails, and the error names the stylesheet rather than the field: `Can't find stylesheet to import`. No Sass option gets around it. If you need to keep the field, turn that target off instead:
|
|
105
|
+
|
|
106
|
+
"targets": { "main": false }
|
|
107
|
+
|
|
108
|
+
To use a `pkg:` URL, create the importer in a `.sassrc.js`. Setting `pkgImporter` in `.sassrc.json` does not work: Parcel switches Sass to its legacy API for that option, and the import is not found.
|
|
109
|
+
|
|
110
|
+
// .sassrc.js
|
|
111
|
+
const { NodePackageImporter } = require("sass");
|
|
112
|
+
module.exports = { importers: [new NodePackageImporter()] };
|
|
113
|
+
|
|
114
|
+
Two more things worth knowing:
|
|
115
|
+
|
|
116
|
+
- **Pass the font formats you actually have to `font-face`.** It lists five by default, and Parcel resolves every `url()` in the output, so a folder holding only `.woff2` fails with `Failed to resolve './fonts/inter.eot'`. `$file-formats: woff2` fixes it.
|
|
117
|
+
- **`quietDeps` hides the library's own deprecation warnings.** Dart Sass reports its `if()` deprecation from inside the package on every build. A `.sassrc.json` of `{ "quietDeps": true }` silences those and still reports the ones in your own files.
|
|
118
|
+
|
|
97
119
|
### Using with Next.js
|
|
98
120
|
|
|
99
121
|
Next.js needs to be told where the library lives. In `next.config.mjs`:
|
|
@@ -187,6 +209,7 @@ Including to the project:
|
|
|
187
209
|
| Angular CLI | 20.3.36 |
|
|
188
210
|
| Gulp / gulp-sass | 5.0.1 / 6.0.1 |
|
|
189
211
|
| Grunt / grunt-sass | 1.6.3 / 4.1.0 |
|
|
212
|
+
| Parcel / @parcel/transformer-sass | 2.16.4 / 2.16.4, with Dart Sass 1.104.1 and Gerillass 2.1.0 |
|
|
190
213
|
|
|
191
214
|
## Using Gerillass with an AI coding agent
|
|
192
215
|
|
package/SKILL.md
CHANGED
|
@@ -76,6 +76,7 @@ a dropped declaration rather than an error.
|
|
|
76
76
|
| `before` | `.a { @include before(42) { color: red; } }` |
|
|
77
77
|
| `border-box` | `@include border-box(only);` |
|
|
78
78
|
| `border-radius` | `.a { @include border-radius(1px, 2px, 3px); }` |
|
|
79
|
+
| `breakpoint` | `.a { @include breakpoint("between", "medium", "large") { color: red; } }` |
|
|
79
80
|
| `breakpointer` | `.a { @include breakpointer(42); }` |
|
|
80
81
|
| `center` | `.modal { @include center(diagonal); }` |
|
|
81
82
|
| `columnizer` | `.grid { @include columnizer(3, 20px, true, 9); }` |
|
|
@@ -93,6 +94,7 @@ a dropped declaration rather than an error.
|
|
|
93
94
|
| `remove` | `.a { @include remove(a, b, c); }` |
|
|
94
95
|
| `reset-css` | `.a { @include reset-css; }` |
|
|
95
96
|
| `scissors` | `.a { @include scissors(5px 10px); }` |
|
|
97
|
+
| `screen-agent` | `.a { @include screen-agent(var(--density)) { color: red; } }` |
|
|
96
98
|
| `smartphone` | `.a { @include smartphone(Nokia3310) { display: none; } }` |
|
|
97
99
|
| `sprite` | `.icon { @include sprite("/img/sprite.txt"); }` |
|
|
98
100
|
| `stretched-link` | `.card a { @include stretched-link(middle); }` |
|
|
@@ -102,6 +104,42 @@ a dropped declaration rather than an error.
|
|
|
102
104
|
| `text-shadow` | `.a { @include text-shadow(42); }` |
|
|
103
105
|
| `triangle` | `.caret { @include triangle(sideways); }` |
|
|
104
106
|
|
|
107
|
+
## Traps a signature does not show
|
|
108
|
+
|
|
109
|
+
**`after`**
|
|
110
|
+
|
|
111
|
+
- With no argument no `content` is emitted, so the pseudo-element does not render unless the block sets `content`. Pass `""` for an empty one.
|
|
112
|
+
|
|
113
|
+
**`aspect-ratio`**
|
|
114
|
+
|
|
115
|
+
- On an element with a `height` attribute, such as `<img width="1600" height="900">` or an embed code's `<iframe>`, the attribute height wins and the ratio is ignored. Write `height: auto` after the include.
|
|
116
|
+
|
|
117
|
+
**`before`**
|
|
118
|
+
|
|
119
|
+
- With no argument no `content` is emitted, so the pseudo-element does not render unless the block sets `content`. Pass `""` for an empty one.
|
|
120
|
+
|
|
121
|
+
**`breakpoint`**
|
|
122
|
+
|
|
123
|
+
- With one argument the query matches exactly that width, `(width: 768px)`, which is a single pixel. Use `min`, `max` or a range for anything wider.
|
|
124
|
+
- Declarations written after the include, in the same rule, are emitted after the `@media` block and win over it. Write them before the include.
|
|
125
|
+
|
|
126
|
+
**`container`**
|
|
127
|
+
|
|
128
|
+
- An element does not match a `@container` query that reads its own container, and nothing warns. Put the `container-query` on a descendant.
|
|
129
|
+
|
|
130
|
+
**`counter`**
|
|
131
|
+
|
|
132
|
+
- Numbering restarts on every item, each showing the first number, when the items are size containers (`container-type: inline-size`): containment scopes counters to each item.
|
|
133
|
+
|
|
134
|
+
**`loadify`**
|
|
135
|
+
|
|
136
|
+
- `init` and every call must be in the same module, or the module with the call must `@use` the one that calls `init`. Otherwise Sass fails with "The target selector was not found".
|
|
137
|
+
|
|
138
|
+
**`remove`**
|
|
139
|
+
|
|
140
|
+
- With one argument the element is hidden at exactly that width, `(width: 768px)`, which is a single pixel. Use `min`, `max` or a range for anything wider.
|
|
141
|
+
- A `display` written after the include, in the same rule, is emitted after the `@media` block and wins over it. Write it before the include.
|
|
142
|
+
|
|
105
143
|
## Mixins
|
|
106
144
|
|
|
107
145
|
| Signature | What it does |
|
|
@@ -112,7 +150,7 @@ a dropped declaration rather than an error.
|
|
|
112
150
|
| `all-text-inputs($pseudo: null)` | Targets every text-like input at once, optionally in one pseudo-class state. |
|
|
113
151
|
| `antialias($value: null)` | Turns on subpixel-antialiased text smoothing. |
|
|
114
152
|
| `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. |
|
|
115
|
-
| `background-dots($color: null, $size: 1em, $gutter:
|
|
153
|
+
| `background-dots($color: null, $size: 1em, $gutter: null, $diagonal: true, $image: null)` | Repeating dot pattern as a background, optionally over an image. |
|
|
116
154
|
| `background-image($image-url: null, $filter-color: null, $filter-direction: null)` | Background image with an optional colour or gradient filter laid over it. |
|
|
117
155
|
| `background-stripes($color: null, $thickness: 1em, $rotation: -45deg, $image: null)` | Repeating stripe pattern as a background, optionally over an image. |
|
|
118
156
|
| `before($content: null)` | Styles the ::before pseudo-element. A `data-` argument becomes an attr() content value. |
|
|
@@ -141,7 +179,7 @@ a dropped declaration rather than an error.
|
|
|
141
179
|
| `placeholder` | Styles the placeholder text of an input across vendor prefixes. |
|
|
142
180
|
| `position($position: absolute, $offsets: 0)` | Sets position and offsets in one call, using shorthand order. |
|
|
143
181
|
| `radial-gradient($shape, $position, $colors)` | Radial gradient background from a shape and a position. |
|
|
144
|
-
| `remove($params...)` | Hides an element outright, or
|
|
182
|
+
| `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. |
|
|
145
183
|
| `reset-css` | Meyer reset. Must be called at the root of the stylesheet. |
|
|
146
184
|
| `reset-figure` | Removes default figure margins and makes the image inside responsive. |
|
|
147
185
|
| `resizable($direction: both, $overflow: auto)` | Makes an element user-resizable. |
|
|
@@ -187,7 +225,7 @@ and camelCase is what tells them apart from the kebab-case mixins above.
|
|
|
187
225
|
| `shorthandProperty($value)` | Expands one to four values into the four-value CSS shorthand order. |
|
|
188
226
|
| `tint($color, $percentage)` | Mixes a colour towards white by a percentage. |
|
|
189
227
|
| `validateBreakpoint($value)` | Resolves a breakpoint name to its width, passing other values through. |
|
|
190
|
-
| `validateLength($value)` | Returns the value if it is a length or one of auto, inherit, initial, 0. |
|
|
228
|
+
| `validateLength($value)` | Returns the value if it is a length or one of auto, inherit, initial, 0. Returns null quietly for null, so a caller can skip a value. |
|
|
191
229
|
| `validateRatio($ratio)` | Turns an aspect ratio into a value for the CSS aspect-ratio property. |
|
|
192
230
|
| `validateScissors($value)` | Normalises corner values for the scissors mixin, adding px where missing. |
|
|
193
231
|
|