gerillass 1.6.1 → 1.6.2

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 CHANGED
@@ -31,6 +31,7 @@ Hope you’ll enjoy using it!
31
31
  - [Using with Grunt](#using-with-grunt)
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
+ - [Using Gerillass with an AI coding agent](#using-gerillass-with-an-ai-coding-agent)
34
35
  - [Namespace Usage](#namespace-usage)
35
36
  - [Vendor Prefix Support](#vendor-prefix-support)
36
37
  - [Experimenting](#experimenting)
@@ -186,6 +187,24 @@ Including to the project:
186
187
  | Gulp / gulp-sass | 5.0.1 / 6.0.1 |
187
188
  | Grunt / grunt-sass | 1.6.3 / 4.1.0 |
188
189
 
190
+ ## Using Gerillass with an AI coding agent
191
+
192
+ Gerillass ships two files that let a coding agent use the library correctly instead of guessing at it. Both are inside the installed package, so an agent working in your project can read them straight out of `node_modules/gerillass/`.
193
+
194
+ **`gerillass.json`** describes every mixin and function: its signature, what each argument accepts, examples that compile, and inputs that are refused.
195
+
196
+ const api = require("gerillass/gerillass.json");
197
+
198
+ **`SKILL.md`** is a written guide generated from that manifest — how to load the library, the full catalogue, and the argument forms that are easy to get wrong. If your agent supports [Agent Skills](https://code.claude.com/docs/en/skills), copy it into your skills folder:
199
+
200
+ mkdir -p .claude/skills/gerillass
201
+ cp node_modules/gerillass/SKILL.md .claude/skills/gerillass/
202
+
203
+ Otherwise, point your agent at the file and it will read it as plain Markdown.
204
+
205
+ 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
+
207
+
189
208
  ## Namespace Usage
190
209
 
191
210
  You can use Gerillass with or without `gls-` namespace. It is optional, but I strongly recommend you to use it to prevent having conflicts with other Sass libraries or frameworks like Bootstrap.
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: 51 mixins and 21 functions that emit CSS from
8
+ A Sass mixin library: 51 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
 
@@ -171,6 +171,7 @@ functions rather than mixins; they are public API.
171
171
  | `__fontSizer($size, $time)` | Multiplies a size by a factor. Handy for a modular scale. |
172
172
  | `__fontSource($font-family, $file-path, $file-formats)` | Builds one src entry for an @font-face rule. |
173
173
  | `__isColor($value)` | Returns the value if every item in it is a colour, and errors otherwise. |
174
+ | `__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(). |
174
175
  | `__isNumber($value)` | Returns the value if it is a number. |
175
176
  | `__isTime($value)` | Returns the value if it is a time in s or ms, and errors otherwise. |
176
177
  | `__lighten($color, $percentage)` | Mixes a colour towards white by a percentage. |
package/gerillass.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gerillass",
3
- "version": "1.6.1",
3
+ "version": "1.6.2",
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",
@@ -506,8 +506,8 @@
506
506
  "name": "$params",
507
507
  "variadic": true,
508
508
  "accepts": [
509
- "a column count",
510
- "a column count plus a gutter length",
509
+ "a column count, which may be a CSS function such as var(--cols)",
510
+ "a column count plus a gutter length, which may also be a CSS function",
511
511
  "a column count plus a boolean fill flag",
512
512
  "a column count, a gutter and a fill flag"
513
513
  ]
@@ -519,10 +519,13 @@
519
519
  "examples": [
520
520
  ".grid { @include columnizer(3); }",
521
521
  ".grid { @include columnizer(3, 20px); }",
522
- ".grid { @include columnizer(3, 20px, true); }"
522
+ ".grid { @include columnizer(3, 20px, true); }",
523
+ ".grid { @include columnizer(3, var(--gap)); }",
524
+ ".grid { @include columnizer(var(--cols)); }"
523
525
  ],
524
526
  "rejects": [
525
- ".grid { @include columnizer(3, 20px, true, 9); }"
527
+ ".grid { @include columnizer(3, 20px, true, 9); }",
528
+ ".grid { @include columnizer(3, nonsense); }"
526
529
  ]
527
530
  },
528
531
  {
@@ -1590,6 +1593,27 @@
1590
1593
  ".a { color: __isColor(nonsense); }"
1591
1594
  ]
1592
1595
  },
1596
+ {
1597
+ "name": "__isGutter",
1598
+ "kind": "function",
1599
+ "arguments": [
1600
+ {
1601
+ "name": "$value",
1602
+ "required": true,
1603
+ "accepts": [
1604
+ "any value"
1605
+ ]
1606
+ }
1607
+ ],
1608
+ "file": "scss/utilities/_is-gutter.scss",
1609
+ "signature": "__isGutter($value)",
1610
+ "summary": "True for anything that can sit where a CSS length is expected: a number, a calculation, or a CSS function such as var().",
1611
+ "examples": [
1612
+ ".a { --x: #{__isGutter(20px)}; }",
1613
+ ".a { --x: #{__isGutter(var(--gap))}; }"
1614
+ ],
1615
+ "rejects": []
1616
+ },
1593
1617
  {
1594
1618
  "name": "__isNumber",
1595
1619
  "kind": "function",
package/package.json CHANGED
@@ -16,13 +16,13 @@
16
16
  }
17
17
  },
18
18
  "license": "Apache-2.0",
19
- "version": "1.6.1",
19
+ "version": "1.6.2",
20
20
  "repository": {
21
21
  "type": "git",
22
22
  "url": "git+https://github.com/selfishprimate/gerillass.git"
23
23
  },
24
24
  "bugs": {
25
- "url": "https://github.com/selfihsprimate/gerillass/issues"
25
+ "url": "https://github.com/selfishprimate/gerillass/issues"
26
26
  },
27
27
  "keywords": [
28
28
  "gerillass",
@@ -587,7 +587,7 @@
587
587
  &:not(:last-child) {
588
588
  margin-right: 0;
589
589
  }
590
- } @else if type-of(nth($params, 2)) == number {
590
+ } @else if __isGutter(nth($params, 2)) {
591
591
  $gutter: nth($params, length($params));
592
592
  flex-grow: 0;
593
593
  flex-shrink: 0;
@@ -600,7 +600,7 @@
600
600
  margin-right: 0;
601
601
  }
602
602
  } @else {
603
- @error "`#{nth($params, 2)}` is not a valid second argument for `columnizer`. Pass a gutter length such as `20px`, or a boolean telling the last row whether to fill.";
603
+ @error "`#{nth($params, 2)}` is not a valid second argument for `columnizer`. Pass a gutter length such as `20px` or `var(--gap)`, or a boolean telling the last row whether to fill.";
604
604
  }
605
605
  } @else if length($params) == 3 {
606
606
  $gutter: nth($params, 2);
@@ -27,6 +27,7 @@
27
27
  @import "utilities/font-sizer";
28
28
  @import "utilities/font-source";
29
29
  @import "utilities/is-color";
30
+ @import "utilities/is-gutter";
30
31
  @import "utilities/is-number";
31
32
  @import "utilities/is-time";
32
33
  @import "utilities/lighten";
@@ -27,7 +27,7 @@
27
27
  &:not(:last-child) {
28
28
  margin-right: 0;
29
29
  }
30
- } @else if type-of(nth($params, 2)) == number {
30
+ } @else if __isGutter(nth($params, 2)) {
31
31
  $gutter: nth($params, length($params));
32
32
  flex-grow: 0;
33
33
  flex-shrink: 0;
@@ -40,7 +40,7 @@
40
40
  margin-right: 0;
41
41
  }
42
42
  } @else {
43
- @error "`#{nth($params, 2)}` is not a valid second argument for `columnizer`. Pass a gutter length such as `20px`, or a boolean telling the last row whether to fill.";
43
+ @error "`#{nth($params, 2)}` is not a valid second argument for `columnizer`. Pass a gutter length such as `20px` or `var(--gap)`, or a boolean telling the last row whether to fill.";
44
44
  }
45
45
  } @else if length($params) == 3 {
46
46
  $gutter: nth($params, 2);
@@ -0,0 +1,21 @@
1
+ @charset "UTF-8";
2
+
3
+ // True for anything that can legally sit where a CSS length is expected: a
4
+ // number, a Sass calculation such as calc() or clamp(), or an unquoted string
5
+ // holding a parenthesis, which is how var() and env() arrive.
6
+ //
7
+ // Written because `type-of($value) == number` rejects `var(--gap)`, and a
8
+ // gutter expressed as a custom property is perfectly reasonable CSS.
9
+
10
+ @function __isGutter($value) {
11
+ @if type-of($value) == "number" {
12
+ @return true;
13
+ }
14
+ @if type-of($value) == "calculation" {
15
+ @return true;
16
+ }
17
+ @if type-of($value) == "string" and str-index(quote($value), "(") {
18
+ @return true;
19
+ }
20
+ @return false;
21
+ }