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/gerillass.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gerillass",
3
- "version": "2.1.0",
3
+ "version": "2.1.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",
@@ -42,17 +42,23 @@
42
42
  "accepts": [
43
43
  "a string used as the content value",
44
44
  "a data- attribute name, rendered as attr()",
45
- "null to write content yourself"
45
+ "null to write content yourself",
46
+ "var(), attr(), counter() or counters(), written as they are"
46
47
  ]
47
48
  }
48
49
  ],
49
50
  "file": "scss/library/_after.scss",
50
51
  "signature": "after($content: null)",
51
52
  "summary": "Styles the ::after pseudo-element. A `data-` argument becomes an attr() content value.",
53
+ "caveats": [
54
+ "With no argument no `content` is emitted, so the pseudo-element does not render unless the block sets `content`. Pass `\"\"` for an empty one."
55
+ ],
52
56
  "examples": [
53
57
  ".a { @include after(\"→\") { color: red; } }",
54
58
  ".a { @include after(\"data-label\") { color: red; } }",
55
- ".a { @include after { content: \"x\"; } }"
59
+ ".a { @include after { content: \"x\"; } }",
60
+ ".a { @include after(var(--label)) { color: red; } }",
61
+ ".a { @include after(attr(data-label)) { color: red; } }"
56
62
  ],
57
63
  "rejects": [
58
64
  ".a { @include after(42) { color: red; } }",
@@ -151,7 +157,8 @@
151
157
  "a slash separated string, such as \"16/9\"",
152
158
  "a colon separated string, such as \"16:9\"",
153
159
  "a number, where 1.5 means 1.5 / 1",
154
- "null for the 16/9 default"
160
+ "null for the 16/9 default",
161
+ "var(), written as it is"
155
162
  ]
156
163
  },
157
164
  {
@@ -170,17 +177,22 @@
170
177
  "file": "scss/library/_aspect-ratio.scss",
171
178
  "signature": "aspect-ratio($ratio: null, $fit: cover)",
172
179
  "summary": "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.",
180
+ "caveats": [
181
+ "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."
182
+ ],
173
183
  "examples": [
174
184
  ".thumb { @include aspect-ratio(\"16:9\"); }",
175
185
  ".video { @include aspect-ratio(\"16/9\"); }",
176
186
  ".tile { @include aspect-ratio(\"1:1\", contain); }",
177
187
  ".plain { @include aspect-ratio(1.5, null); }",
178
- ".default { @include aspect-ratio; }"
188
+ ".default { @include aspect-ratio; }",
189
+ ".a { @include aspect-ratio(var(--ratio)); }"
179
190
  ],
180
191
  "rejects": [
181
192
  ".thumb { @include aspect-ratio(\"16:9\", nonsense); }",
182
193
  ".thumb { @include aspect-ratio(16 9); }",
183
- ".thumb { @include aspect-ratio(\"sixteen/nine\"); }"
194
+ ".thumb { @include aspect-ratio(\"sixteen/nine\"); }",
195
+ ".a { @include aspect-ratio(url(a.png)); }"
184
196
  ]
185
197
  },
186
198
  {
@@ -199,14 +211,15 @@
199
211
  "name": "$size",
200
212
  "default": "1em",
201
213
  "accepts": [
202
- "dot radius"
214
+ "dot radius: a length, or var(), env() or a calculation such as calc() or clamp()"
203
215
  ]
204
216
  },
205
217
  {
206
218
  "name": "$gutter",
207
- "default": "$size * 5",
219
+ "default": "null",
208
220
  "accepts": [
209
- "spacing between dots"
221
+ "spacing between dots, in the same forms as $size",
222
+ "null, the default, for five times $size"
210
223
  ]
211
224
  },
212
225
  {
@@ -221,21 +234,27 @@
221
234
  "name": "$image",
222
235
  "default": "null",
223
236
  "accepts": [
224
- "an image path to sit behind the dots"
237
+ "an image path to sit behind the dots",
238
+ "var(), url(), image-set() or a gradient, written as they are rather than wrapped in url()"
225
239
  ]
226
240
  }
227
241
  ],
228
242
  "file": "scss/library/_background-dots.scss",
229
- "signature": "background-dots($color: null, $size: 1em, $gutter: $size * 5, $diagonal: true, $image: null)",
243
+ "signature": "background-dots($color: null, $size: 1em, $gutter: null, $diagonal: true, $image: null)",
230
244
  "summary": "Repeating dot pattern as a background, optionally over an image.",
231
245
  "examples": [
232
246
  ".a { @include background-dots; }",
233
247
  ".a { @include background-dots(red); }",
234
- ".a { @include background-dots(red, 1em, 5em, false); }"
248
+ ".a { @include background-dots(red, 1em, 5em, false); }",
249
+ ".a { @include background-dots(red, var(--dot), calc(var(--dot) * 6)); }",
250
+ ".a { @include background-dots(red, clamp(2px, 0.5vw, 6px)); }",
251
+ ".a { @include background-dots(red, $image: var(--photo)); }"
235
252
  ],
236
253
  "rejects": [
237
254
  ".a { @include background-dots(red, 1em, 5em, maybe); }",
238
- ".a { @include background-dots(red, 1em, 5em, true, 42); }"
255
+ ".a { @include background-dots(red, 1em, 5em, true, 42); }",
256
+ ".a { @include background-dots(red, nonsense); }",
257
+ ".a { @include background-dots(red, 1em, nonsense); }"
239
258
  ]
240
259
  },
241
260
  {
@@ -247,7 +266,8 @@
247
266
  "default": "null",
248
267
  "accepts": [
249
268
  "an image path",
250
- "null to filter the element itself instead"
269
+ "null to filter the element itself instead",
270
+ "var(), url(), image-set() or a gradient, written as they are rather than wrapped in url()"
251
271
  ]
252
272
  },
253
273
  {
@@ -272,10 +292,14 @@
272
292
  "examples": [
273
293
  ".a { @include background-image(\"/img/a.png\"); }",
274
294
  ".a { @include background-image(\"/img/a.png\", rgba(0,0,0,0.5)); }",
275
- ".a { @include background-image(\"/img/a.png\", (red, blue), \"top\"); }"
295
+ ".a { @include background-image(\"/img/a.png\", (red, blue), \"top\"); }",
296
+ ".a { @include background-image(var(--hero), rgba(0,0,0,0.5)); }",
297
+ ".a { @include background-image(image-set(\"/img/a.png\" 1x, \"/img/a@2x.png\" 2x)); }"
276
298
  ],
277
299
  "rejects": [
278
- ".a { @include background-image(\"/img/a.png\", (red, blue), sideways); }"
300
+ ".a { @include background-image(\"/img/a.png\", (red, blue), sideways); }",
301
+ ".a { @include background-image(\"/img/a.png\", rgba(0,0,0,0.5), sideways); }",
302
+ ".a { @include background-image(null, rgba(0,0,0,0.5), sideways); }"
279
303
  ]
280
304
  },
281
305
  {
@@ -294,7 +318,7 @@
294
318
  "name": "$thickness",
295
319
  "default": "1em",
296
320
  "accepts": [
297
- "stripe thickness"
321
+ "stripe thickness: a length, or var(), env() or a calculation such as calc() or clamp()"
298
322
  ]
299
323
  },
300
324
  {
@@ -308,7 +332,8 @@
308
332
  "name": "$image",
309
333
  "default": "null",
310
334
  "accepts": [
311
- "an image path to sit behind the stripes"
335
+ "an image path to sit behind the stripes",
336
+ "var(), url(), image-set() or a gradient, written as they are rather than wrapped in url()"
312
337
  ]
313
338
  }
314
339
  ],
@@ -317,11 +342,14 @@
317
342
  "summary": "Repeating stripe pattern as a background, optionally over an image.",
318
343
  "examples": [
319
344
  ".a { @include background-stripes; }",
320
- ".a { @include background-stripes(red, 2em, -30deg); }"
345
+ ".a { @include background-stripes(red, 2em, -30deg); }",
346
+ ".a { @include background-stripes(red blue, var(--stripe)); }",
347
+ ".a { @include background-stripes(red, 2em, -30deg, var(--photo)); }"
321
348
  ],
322
349
  "rejects": [
323
350
  ".a { @include background-stripes(red, 2em, nonsense); }",
324
- ".a { @include background-stripes(red, 2em, -45deg, 42); }"
351
+ ".a { @include background-stripes(red, 2em, -45deg, 42); }",
352
+ ".a { @include background-stripes(red, nonsense); }"
325
353
  ]
326
354
  },
327
355
  {
@@ -334,16 +362,21 @@
334
362
  "accepts": [
335
363
  "a string used as the content value",
336
364
  "a data- attribute name, rendered as attr()",
337
- "null to write content yourself"
365
+ "null to write content yourself",
366
+ "var(), attr(), counter() or counters(), written as they are"
338
367
  ]
339
368
  }
340
369
  ],
341
370
  "file": "scss/library/_before.scss",
342
371
  "signature": "before($content: null)",
343
372
  "summary": "Styles the ::before pseudo-element. A `data-` argument becomes an attr() content value.",
373
+ "caveats": [
374
+ "With no argument no `content` is emitted, so the pseudo-element does not render unless the block sets `content`. Pass `\"\"` for an empty one."
375
+ ],
344
376
  "examples": [
345
377
  ".a { @include before(\"→\") { color: red; } }",
346
- ".a { @include before(\"data-label\") { color: red; } }"
378
+ ".a { @include before(\"data-label\") { color: red; } }",
379
+ ".a { @include before(var(--label)) { color: red; } }"
347
380
  ],
348
381
  "rejects": [
349
382
  ".a { @include before(42) { color: red; } }"
@@ -423,7 +456,8 @@
423
456
  "name": "$image-url",
424
457
  "default": "null",
425
458
  "accepts": [
426
- "an image path"
459
+ "an image path",
460
+ "var(), url(), image-set() or a gradient, written as they are rather than wrapped in url()"
427
461
  ]
428
462
  }
429
463
  ],
@@ -431,7 +465,8 @@
431
465
  "signature": "brand-logo($width, $height, $image-url: null)",
432
466
  "summary": "Logo box with an image and an accessible stretched link over it.",
433
467
  "examples": [
434
- ".logo { @include brand-logo(120px, 40px, \"/img/logo.svg\"); }"
468
+ ".logo { @include brand-logo(120px, 40px, \"/img/logo.svg\"); }",
469
+ ".logo { @include brand-logo(120px, 40px, var(--logo)); }"
435
470
  ],
436
471
  "rejects": []
437
472
  },
@@ -453,12 +488,21 @@
453
488
  "file": "scss/library/_breakpoint.scss",
454
489
  "signature": "breakpoint($params...)",
455
490
  "summary": "Media query built from the breakpoint map, or from raw lengths.",
491
+ "caveats": [
492
+ "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.",
493
+ "Declarations written after the include, in the same rule, are emitted after the `@media` block and win over it. Write them before the include."
494
+ ],
456
495
  "examples": [
457
496
  ".a { @include breakpoint(\"medium\") { color: red; } }",
458
497
  ".a { @include breakpoint(\"min\", \"medium\") { color: red; } }",
459
498
  ".a { @include breakpoint(\"between\", \"medium\" \"large\") { color: red; } }"
460
499
  ],
461
- "rejects": []
500
+ "rejects": [
501
+ ".a { @include breakpoint(\"between\", \"medium\", \"large\") { color: red; } }",
502
+ ".a { @include breakpoint() { color: red; } }",
503
+ ".a { @include breakpoint(\"min\", var(--wide)) { color: red; } }",
504
+ ".a { @include breakpoint(\"between\", var(--start) \"large\") { color: red; } }"
505
+ ]
462
506
  },
463
507
  {
464
508
  "name": "breakpointer",
@@ -599,7 +643,8 @@
599
643
  ],
600
644
  "rejects": [
601
645
  ".title { @include container-query(\"min\", 400px, 800px) { color: red; } }",
602
- ".title { @include container-query(\"min\", 400px, $name: 42) { color: red; } }"
646
+ ".title { @include container-query(\"min\", 400px, $name: 42) { color: red; } }",
647
+ ".title { @include container-query(\"min\", var(--wide)) { color: red; } }"
603
648
  ]
604
649
  },
605
650
  {
@@ -627,6 +672,9 @@
627
672
  "file": "scss/library/_container.scss",
628
673
  "signature": "container($name: null, $type: inline-size)",
629
674
  "summary": "Marks an element as a query container, so container-query can ask about its width instead of the viewport's. The rule that asks has to sit on a descendant: an element is never matched by a @container rule reading its own container, and nothing warns you when it is not.",
675
+ "caveats": [
676
+ "An element does not match a `@container` query that reads its own container, and nothing warns. Put the `container-query` on a descendant."
677
+ ],
630
678
  "examples": [
631
679
  ".card { @include container(\"card\"); }",
632
680
  ".panel { @include container; }",
@@ -647,17 +695,22 @@
647
695
  "accepts": [
648
696
  "a counter style name",
649
697
  "a prefix and/or suffix string",
650
- "a prefix, a counter style and a suffix"
698
+ "a prefix, a counter style and a suffix",
699
+ "var(), attr(), counter() or counters() in place of a prefix or suffix, written as they are"
651
700
  ]
652
701
  }
653
702
  ],
654
703
  "file": "scss/library/_counter.scss",
655
704
  "signature": "counter($params...)",
656
705
  "summary": "CSS counter for a list, with optional text before and after the number.",
706
+ "caveats": [
707
+ "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."
708
+ ],
657
709
  "examples": [
658
710
  ".list { @include counter(\"decimal\"); }",
659
711
  ".list { @include counter(\".\"); }",
660
- ".list { @include counter(\"(\", \"decimal\", \")\"); }"
712
+ ".list { @include counter(\"(\", \"decimal\", \")\"); }",
713
+ ".list { @include counter(var(--prefix), \"decimal\"); }"
661
714
  ],
662
715
  "rejects": []
663
716
  },
@@ -788,7 +841,11 @@
788
841
  "rejects": [
789
842
  ".a { @include font-face(\"Inter\", \"/fonts/inter\"); }",
790
843
  "@include font-face(42, \"/fonts/x\");",
791
- "@include font-face(\"Inter\", 42);"
844
+ "@include font-face(\"Inter\", 42);",
845
+ "@include font-face(\"Inter\", \"/fonts/inter\", $file-formats: otf);",
846
+ "@include font-face(\"Inter\", \"/fonts/inter\", $file-formats: woff2 wof);",
847
+ "@include font-face(\"Inter\", \"/fonts/inter\", $file-formats: null);",
848
+ "@include font-face(\"Inter\", var(--font-path));"
792
849
  ]
793
850
  },
794
851
  {
@@ -824,7 +881,8 @@
824
881
  "default": "3",
825
882
  "accepts": [
826
883
  "a whole number of lines, at least 1",
827
- "none, to undo a clamp"
884
+ "none, to undo a clamp",
885
+ "var(), written as it is"
828
886
  ]
829
887
  }
830
888
  ],
@@ -835,13 +893,15 @@
835
893
  ".excerpt { @include line-clamp(3); }",
836
894
  ".title { @include line-clamp(2); }",
837
895
  ".full { @include line-clamp(none); }",
838
- ".default { @include line-clamp; }"
896
+ ".default { @include line-clamp; }",
897
+ ".a { @include line-clamp(var(--lines)); }"
839
898
  ],
840
899
  "rejects": [
841
900
  ".a { @include line-clamp(0); }",
842
901
  ".a { @include line-clamp(2.5); }",
843
902
  ".a { @include line-clamp(3px); }",
844
- ".a { @include line-clamp(\"three\"); }"
903
+ ".a { @include line-clamp(\"three\"); }",
904
+ ".a { @include line-clamp(url(a.png)); }"
845
905
  ]
846
906
  },
847
907
  {
@@ -892,6 +952,9 @@
892
952
  "file": "scss/library/_loadify.scss",
893
953
  "signature": "loadify($params...)",
894
954
  "summary": "Fades elements in on page load. Call once at the root to set up, then on each element. Under prefers-reduced-motion: reduce the end state is applied directly and no animation runs. Switching the animation off alone would not do, because the element starts invisible and the animation is what reveals it, so the content would stay hidden for good.",
955
+ "caveats": [
956
+ "`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\"."
957
+ ],
895
958
  "examples": [
896
959
  "@include loadify(init);\n.a { @include loadify; }",
897
960
  "@include loadify;\n.a { @include loadify(0.4s, 1s); }"
@@ -966,7 +1029,8 @@
966
1029
  "name": "$offsets",
967
1030
  "default": "0",
968
1031
  "accepts": [
969
- "one to four lengths in shorthand order, or auto/inherit/initial/0"
1032
+ "one to four lengths in shorthand order, or auto/inherit/initial/0",
1033
+ "null in any position to leave that edge out"
970
1034
  ]
971
1035
  }
972
1036
  ],
@@ -975,7 +1039,9 @@
975
1039
  "summary": "Sets position and offsets in one call, using shorthand order.",
976
1040
  "examples": [
977
1041
  ".a { @include position(absolute, 0); }",
978
- ".a { @include position(fixed, 0 10px); }"
1042
+ ".a { @include position(fixed, 0 10px); }",
1043
+ ".a { @include position(absolute, null 16px 16px 16px); }",
1044
+ ".a { @include position(absolute, 0 null null 0); }"
979
1045
  ],
980
1046
  "rejects": []
981
1047
  },
@@ -1026,7 +1092,7 @@
1026
1092
  "variadic": true,
1027
1093
  "accepts": [
1028
1094
  "nothing, to hide it always",
1029
- "one breakpoint",
1095
+ "one breakpoint, for exactly that width and no other",
1030
1096
  "min or max plus a breakpoint",
1031
1097
  "a start and an end breakpoint"
1032
1098
  ]
@@ -1034,14 +1100,20 @@
1034
1100
  ],
1035
1101
  "file": "scss/library/_remove.scss",
1036
1102
  "signature": "remove($params...)",
1037
- "summary": "Hides an element outright, or only within a breakpoint range.",
1103
+ "summary": "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.",
1104
+ "caveats": [
1105
+ "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.",
1106
+ "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."
1107
+ ],
1038
1108
  "examples": [
1039
1109
  ".a { @include remove; }",
1040
- ".a { @include remove(\"medium\"); }",
1041
- ".a { @include remove(\"min\", \"medium\"); }"
1110
+ ".a { @include remove(\"min\", \"medium\"); }",
1111
+ ".a { @include remove(\"max\", \"medium\"); }",
1112
+ ".a { @include remove(\"small\", \"large\"); }"
1042
1113
  ],
1043
1114
  "rejects": [
1044
- ".a { @include remove(a, b, c); }"
1115
+ ".a { @include remove(a, b, c); }",
1116
+ ".a { @include remove(\"max\", var(--narrow)); }"
1045
1117
  ]
1046
1118
  },
1047
1119
  {
@@ -1154,7 +1226,9 @@
1154
1226
  "examples": [
1155
1227
  ".a { @include screen-agent(\"2x\") { background-image: url(\"/img/a@2x.png\"); } }"
1156
1228
  ],
1157
- "rejects": []
1229
+ "rejects": [
1230
+ ".a { @include screen-agent(var(--density)) { color: red; } }"
1231
+ ]
1158
1232
  },
1159
1233
  {
1160
1234
  "name": "sizer",
@@ -1337,7 +1411,8 @@
1337
1411
  "name": "$image",
1338
1412
  "default": "null",
1339
1413
  "accepts": [
1340
- "an image path"
1414
+ "an image path",
1415
+ "var(), url(), image-set() or a gradient, written as they are rather than wrapped in url()"
1341
1416
  ]
1342
1417
  }
1343
1418
  ],
@@ -1345,7 +1420,8 @@
1345
1420
  "signature": "text-image($image: null)",
1346
1421
  "summary": "Fills the text with an image via background-clip.",
1347
1422
  "examples": [
1348
- ".a { @include text-image(\"/img/t.png\"); }"
1423
+ ".a { @include text-image(\"/img/t.png\"); }",
1424
+ ".a { @include text-image(var(--texture)); }"
1349
1425
  ],
1350
1426
  "rejects": []
1351
1427
  },
@@ -1460,14 +1536,17 @@
1460
1536
  "name": "$color",
1461
1537
  "default": "black",
1462
1538
  "accepts": [
1463
- "any colour value"
1539
+ "a Sass colour, such as red, #333 or oklch(70% 0.1 200)",
1540
+ "currentColor",
1541
+ "var(), color-mix() or light-dark(), which CSS resolves"
1464
1542
  ]
1465
1543
  },
1466
1544
  {
1467
1545
  "name": "$size",
1468
1546
  "default": "10px 8px",
1469
1547
  "accepts": [
1470
- "one length, or two lengths as width then height"
1548
+ "one length, or two lengths as width then height",
1549
+ "var(), env() or a calculation in place of any length"
1471
1550
  ]
1472
1551
  }
1473
1552
  ],
@@ -1476,11 +1555,17 @@
1476
1555
  "summary": "Draws a CSS triangle out of borders, pointing in a given direction.",
1477
1556
  "examples": [
1478
1557
  ".caret { @include triangle(\"bottom\", black, 10px 8px); }",
1479
- ".arrow { @include triangle(\"left\", red); }"
1558
+ ".arrow { @include triangle(\"left\", red); }",
1559
+ ".arrow { @include triangle(\"right\", var(--accent), 6px 8px); }",
1560
+ ".arrow { @include triangle(\"right\", currentColor); }",
1561
+ ".arrow { @include triangle(\"top\", color-mix(in srgb, red 50%, blue)); }",
1562
+ ".arrow { @include triangle(\"bottom\", currentColor, var(--caret-w) var(--caret-h)); }"
1480
1563
  ],
1481
1564
  "rejects": [
1482
1565
  ".caret { @include triangle(sideways); }",
1483
- ".caret { @include triangle(\"top\", notacolor); }"
1566
+ ".caret { @include triangle(\"top\", notacolor); }",
1567
+ ".caret { @include triangle(\"top\", url(a.png)); }",
1568
+ ".caret { @include triangle(\"top\", red, nonsense); }"
1484
1569
  ]
1485
1570
  },
1486
1571
  {
@@ -1501,7 +1586,9 @@
1501
1586
  "examples": [
1502
1587
  ".a { line-height: clearUnit(24px); }"
1503
1588
  ],
1504
- "rejects": []
1589
+ "rejects": [
1590
+ ".a { line-height: clearUnit(nonsense); }"
1591
+ ]
1505
1592
  },
1506
1593
  {
1507
1594
  "name": "clearWhitespace",
@@ -1543,7 +1630,10 @@
1543
1630
  "examples": [
1544
1631
  ".a { margin: convertToEm(24px); }"
1545
1632
  ],
1546
- "rejects": []
1633
+ "rejects": [
1634
+ ".a { margin: convertToEm(nonsense); }",
1635
+ ".a { margin: convertToEm(24); }"
1636
+ ]
1547
1637
  },
1548
1638
  {
1549
1639
  "name": "convertToNumber",
@@ -1564,7 +1654,9 @@
1564
1654
  ".a { z-index: convertToNumber(\"42\"); }"
1565
1655
  ],
1566
1656
  "rejects": [
1567
- ".a { --x: #{convertToNumber(42)}; }"
1657
+ ".a { --x: #{convertToNumber(42)}; }",
1658
+ ".a { z-index: convertToNumber(\"4a\"); }",
1659
+ ".a { z-index: convertToNumber(\"\"); }"
1568
1660
  ]
1569
1661
  },
1570
1662
  {
@@ -1678,7 +1770,10 @@
1678
1770
  "examples": [
1679
1771
  ".a { font-size: fontSizer(16px, 1.5); }"
1680
1772
  ],
1681
- "rejects": []
1773
+ "rejects": [
1774
+ ".a { font-size: fontSizer(nonsense, 1.5); }",
1775
+ ".a { font-size: fontSizer(16px, 1px); }"
1776
+ ]
1682
1777
  },
1683
1778
  {
1684
1779
  "name": "fontSource",
@@ -1893,7 +1988,11 @@
1893
1988
  "examples": [
1894
1989
  ".a { font-size: remify(24px); }"
1895
1990
  ],
1896
- "rejects": []
1991
+ "rejects": [
1992
+ ".a { font-size: remify(nonsense); }",
1993
+ ".a { font-size: remify(1.5rem); }",
1994
+ ".a { font-size: remify(24); }"
1995
+ ]
1897
1996
  },
1898
1997
  {
1899
1998
  "name": "shade",
@@ -1921,7 +2020,8 @@
1921
2020
  ".a { color: shade(red, 20%); }"
1922
2021
  ],
1923
2022
  "rejects": [
1924
- ".a { color: shade(notacolor, 20%); }"
2023
+ ".a { color: shade(notacolor, 20%); }",
2024
+ ".a { color: shade(var(--x), 20%); }"
1925
2025
  ]
1926
2026
  },
1927
2027
  {
@@ -1972,7 +2072,8 @@
1972
2072
  ".a { color: tint(red, 20%); }"
1973
2073
  ],
1974
2074
  "rejects": [
1975
- ".a { color: tint(notacolor, 20%); }"
2075
+ ".a { color: tint(notacolor, 20%); }",
2076
+ ".a { color: tint(var(--x), 20%); }"
1976
2077
  ]
1977
2078
  },
1978
2079
  {
@@ -2003,13 +2104,14 @@
2003
2104
  "name": "$value",
2004
2105
  "required": true,
2005
2106
  "accepts": [
2006
- "a length with a unit, or auto, inherit, initial, 0"
2107
+ "a length with a unit, or auto, inherit, initial, 0",
2108
+ "null, returned as null without a warning"
2007
2109
  ]
2008
2110
  }
2009
2111
  ],
2010
2112
  "file": "scss/utilities/_validate-length.scss",
2011
2113
  "signature": "validateLength($value)",
2012
- "summary": "Returns the value if it is a length or one of auto, inherit, initial, 0.",
2114
+ "summary": "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.",
2013
2115
  "examples": [
2014
2116
  ".a { width: validateLength(20px); }"
2015
2117
  ],
@@ -2025,7 +2127,8 @@
2025
2127
  "accepts": [
2026
2128
  "a string such as \"16/9\" or \"16:9\"",
2027
2129
  "a unitless number",
2028
- "null for the 16/9 default"
2130
+ "null for the 16/9 default",
2131
+ "var(), returned as it is"
2029
2132
  ]
2030
2133
  }
2031
2134
  ],
@@ -2034,10 +2137,12 @@
2034
2137
  "summary": "Turns an aspect ratio into a value for the CSS aspect-ratio property.",
2035
2138
  "examples": [
2036
2139
  ".a { aspect-ratio: validateRatio(\"16/9\"); }",
2037
- ".a { aspect-ratio: validateRatio(1.5); }"
2140
+ ".a { aspect-ratio: validateRatio(1.5); }",
2141
+ ".a { aspect-ratio: validateRatio(var(--ratio)); }"
2038
2142
  ],
2039
2143
  "rejects": [
2040
- ".a { aspect-ratio: validateRatio(16 9); }"
2144
+ ".a { aspect-ratio: validateRatio(16 9); }",
2145
+ ".a { aspect-ratio: validateRatio(\"16 / 9\"); }"
2041
2146
  ]
2042
2147
  },
2043
2148
  {
package/package.json CHANGED
@@ -16,7 +16,7 @@
16
16
  }
17
17
  },
18
18
  "license": "Apache-2.0",
19
- "version": "2.1.0",
19
+ "version": "2.1.1",
20
20
  "repository": {
21
21
  "type": "git",
22
22
  "url": "git+https://github.com/selfishprimate/gerillass.git"
@@ -1,14 +1,29 @@
1
1
  @charset "UTF-8";
2
2
 
3
+ @use "sass:list";
3
4
  @use "sass:meta";
4
5
  @use "sass:string";
5
6
 
7
+ // True for an unquoted call to one of $names, such as var(--x). A quoted string
8
+ // stays text, so `"var(--x)"` is not a call.
9
+ @function -is-css-function($value, $names) {
10
+ @if meta.type-of($value) != "string" or string.slice(meta.inspect($value), 1, 1) == "\"" {
11
+ @return false;
12
+ }
13
+ $open: string.index($value, "(");
14
+ @return $open != null and list.index($names, string.to-lower-case(string.slice($value, 1, $open - 1))) != null;
15
+ }
16
+
6
17
  @mixin after($content: null) {
7
18
  &::after {
8
19
  @if $content == null {
9
20
  @content;
10
21
  } @else if meta.type-of($content) != "string" {
11
22
  @error "`#{$content}` is not a valid $content for `after`. Pass a string to use as the content value, a data- attribute name such as `\"data-label\"` to render it with attr(), or no argument at all and write the content yourself.";
23
+ } @else if -is-css-function($content, "var" "attr" "counter" "counters") {
24
+ // Quoting would turn the call into text: content: "var(--label)".
25
+ content: $content;
26
+ @content;
12
27
  } @else {
13
28
  $data: string.slice($content, 1, 5);
14
29
  @if $data == "data-" {