@codenhub/styles 0.8.0 → 0.9.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.
Files changed (76) hide show
  1. package/README.es.md +9 -9
  2. package/README.md +8 -8
  3. package/README.pt-BR.md +9 -9
  4. package/dist/aesthetics/chunky-tile.css +1 -1
  5. package/dist/aesthetics/cyber.css +1 -1
  6. package/dist/aesthetics/glass.css +1 -1
  7. package/dist/aesthetics/index.css +1 -1
  8. package/dist/aesthetics/neobrutalism.css +1 -1
  9. package/dist/aesthetics/pixel.css +1 -1
  10. package/dist/aesthetics/sketch.css +1 -1
  11. package/dist/cli.js +231 -62
  12. package/dist/components.css +49 -1
  13. package/dist/index.css +49 -1
  14. package/dist/native.css +49 -1
  15. package/dist/purge/classes.json +1 -0
  16. package/dist/purge/index.css +50 -0
  17. package/dist/theme.css +1 -1
  18. package/docs/changelog/0.8.0.md +1 -1
  19. package/docs/changelog/0.9.0.md +40 -0
  20. package/docs/changelog/index.md +1 -0
  21. package/docs/es/index.md +2 -2
  22. package/docs/es/integrating/tailwind.md +2 -1
  23. package/docs/es/integrating/without-a-bundler.md +60 -31
  24. package/docs/es/setup.md +4 -3
  25. package/docs/es/usage/aesthetics.md +2 -2
  26. package/docs/es/usage/content-and-layout.md +3 -1
  27. package/docs/es/usage/customizing.md +30 -16
  28. package/docs/es/usage/forms.md +2 -2
  29. package/docs/es/usage/index.md +2 -2
  30. package/docs/es/usage/solo.md +2 -2
  31. package/docs/es/usage/theming.md +2 -2
  32. package/docs/es/usage/tooltips.md +2 -2
  33. package/docs/index.md +1 -1
  34. package/docs/integrating/tailwind.md +1 -0
  35. package/docs/integrating/without-a-bundler.md +59 -30
  36. package/docs/pt-BR/index.md +2 -2
  37. package/docs/pt-BR/integrating/tailwind.md +2 -1
  38. package/docs/pt-BR/integrating/without-a-bundler.md +60 -31
  39. package/docs/pt-BR/setup.md +4 -3
  40. package/docs/pt-BR/usage/aesthetics.md +2 -2
  41. package/docs/pt-BR/usage/content-and-layout.md +3 -1
  42. package/docs/pt-BR/usage/customizing.md +30 -16
  43. package/docs/pt-BR/usage/forms.md +2 -2
  44. package/docs/pt-BR/usage/index.md +2 -2
  45. package/docs/pt-BR/usage/solo.md +2 -2
  46. package/docs/pt-BR/usage/theming.md +2 -2
  47. package/docs/pt-BR/usage/tooltips.md +2 -2
  48. package/docs/setup.md +3 -2
  49. package/docs/usage/aesthetics.md +1 -1
  50. package/docs/usage/content-and-layout.md +2 -0
  51. package/docs/usage/customizing.md +29 -15
  52. package/docs/usage/forms.md +1 -1
  53. package/docs/usage/index.md +1 -1
  54. package/docs/usage/solo.md +1 -1
  55. package/docs/usage/theming.md +1 -1
  56. package/docs/usage/tooltips.md +1 -1
  57. package/llms-full.txt +145 -61
  58. package/llms.txt +3 -2
  59. package/package.json +12 -10
  60. package/tw/aesthetics/chunky-tile.css +4 -1
  61. package/tw/aesthetics/cyber.css +4 -1
  62. package/tw/aesthetics/glass.css +5 -0
  63. package/tw/aesthetics/neobrutalism.css +4 -1
  64. package/tw/aesthetics/pixel.css +3 -0
  65. package/tw/aesthetics/sketch.css +18 -0
  66. package/tw/box.css +21 -15
  67. package/tw/components/button.rules.css +1 -1
  68. package/tw/components/feedback.rules.css +22 -3
  69. package/tw/components/form.rules.css +65 -35
  70. package/tw/components/surface.rules.css +8 -5
  71. package/tw/components/tooltip.rules.css +39 -34
  72. package/tw/elevation.css +8 -8
  73. package/tw/native.css +4 -1
  74. package/tw/theme.css +1 -1
  75. package/tw/utilities/content.css +74 -54
  76. package/tw/utilities/layout.css +7 -5
@@ -77,16 +77,16 @@
77
77
  two presentations separate. A larger multiplier lands both on a fully
78
78
  opaque plate, leaving only the small intent mix to tell them apart.
79
79
 
80
- It reads `--ui-fill` rather than `--table-fill` because the question is
80
+ It reads `--ui-fill` rather than `--_table-fill` because the question is
81
81
  what the presentation wanted, not what the intent cap and an aesthetic's
82
82
  alpha left of it: a glass `.soft` table still wants its head plate, and
83
83
  neutral's 20% cap has no bearing on whether there is one. Reading the raw
84
84
  class value also keeps the expression a `calc()` over one `var()` rather
85
- than over `--table-fill`'s own `calc()`/`min()` chain, which matters for
86
- the reason `--table-rule-plated` below records. */
87
- --table-ground: min(100%, calc(var(--ui-fill, var(--_d-fill)) * 5));
88
- --table-head-bg: color-mix(in oklab, var(--intent-color) var(--table-fill), var(--table-head-plate));
89
- --table-head-fg: color-mix(in oklab, var(--intent-contrast) var(--_on-fill), var(--intent-strong));
85
+ than over `--_table-fill`'s own `calc()`/`min()` chain, which matters for
86
+ the reason `--_table-rule-plated` below records. */
87
+ --_table-ground: min(100%, calc(var(--ui-fill, var(--_d-fill)) * 5));
88
+ --_table-head-bg: color-mix(in oklab, var(--intent-color) var(--_table-fill), var(--_table-head-plate));
89
+ --_table-head-fg: color-mix(in oklab, var(--intent-contrast) var(--_on-fill), var(--intent-strong));
90
90
  /* The table's own contrast ink, resolved here so a row with its own intent
91
91
  prints on the table's plate in the ink that plate takes: the row's
92
92
  `--intent-contrast` is chosen for the row's fill, which a row does not
@@ -125,18 +125,18 @@
125
125
  one is named. Head and body share the plate, as they do on the page. Only
126
126
  the quiet rest reads it: a `.solid` table is opaque, like every `.solid`,
127
127
  and a `.ghost` one is boundaries and type. */
128
- --table-ground-plate: var(--ui-surface-ground, var(--color-foreground));
129
- --table-fill: min(
128
+ --_table-ground-plate: var(--ui-surface-ground, var(--color-foreground));
129
+ --_table-fill: min(
130
130
  calc(min(var(--ui-fill, var(--_d-fill)), var(--intent-fill-max, 100%)) * var(--ui-bg-alpha, 1)),
131
131
  calc(100% - var(--_table-quiet))
132
132
  );
133
- --table-head-plate: color-mix(
133
+ --_table-head-plate: color-mix(
134
134
  in oklab,
135
- var(--table-ground-plate) var(--_table-quiet),
136
- color-mix(in oklab, var(--intent-subtle) var(--table-ground), transparent)
135
+ var(--_table-ground-plate) var(--_table-quiet),
136
+ color-mix(in oklab, var(--intent-subtle) var(--_table-ground), transparent)
137
137
  );
138
138
  --_fill-cap: calc(100% - var(--_table-quiet));
139
- --_d-ground: color-mix(in oklab, var(--table-ground-plate) var(--_table-quiet), transparent);
139
+ --_d-ground: color-mix(in oklab, var(--_table-ground-plate) var(--_table-quiet), transparent);
140
140
 
141
141
  /* A table rests on a plate of its own at every fill but `.ghost`, so no
142
142
  ink from above passes through it, as on `surface`. A ghost table on a
@@ -166,8 +166,8 @@
166
166
  both. So `.ruled` writes 100% and gets rules everywhere, `.ruleless` writes
167
167
  0% and gets a table with no lines in it at all, and a table nobody classed
168
168
  sits between them. */
169
- --table-rule-amount: var(--ui-rule, 0%);
170
- --table-boundary-amount: var(--ui-rule, 100%);
169
+ --_table-rule-amount: var(--ui-rule, 0%);
170
+ --_table-boundary-amount: var(--ui-rule, 100%);
171
171
  /* What the rule is drawn in, which is not the same tone at every fill.
172
172
  `.ghost` and `.soft` keep `--intent-border` -- the slot an aesthetic
173
173
  restates through `--ui-ink` -- because at those fills the plate has not
@@ -177,28 +177,28 @@
177
177
  is busiest.
178
178
 
179
179
  The filled case draws in `currentColor` at a fifth instead: the ink the
180
- cell is already printing (`--table-head-fg` on a head, `box`'s own `--_fg`
180
+ cell is already printing (`--_table-head-fg` on a head, `box`'s own `--_fg`
181
181
  in the body), so it reads on a light plate and a dark one without a
182
182
  per-intent branch, and it lands *over* the plate because a translucent
183
183
  border composites onto the background the element already painted.
184
184
 
185
185
  Naming the ink rather than composing it also keeps this expression cheap,
186
186
  which is a requirement: every `th` and `td` on a page resolves it, and
187
- written as `color-mix(--table-head-fg 20%, --_bg)` it expands, through four
187
+ written as `color-mix(--_table-head-fg 20%, --_bg)` it expands, through four
188
188
  levels of substitution, into a `color-mix()` over two more `color-mix()`es
189
189
  over a `min()`/`max()`/`calc()` chain, which crashes WebKit's renderer on
190
190
  the routes that draw tables. `currentColor` and `transparent` are leaves
191
191
  the engine has already resolved, which takes the expression back down to
192
- something every engine can carry. `--table-row-hover` below is written the
192
+ something every engine can carry. `--_table-row-hover` below is written the
193
193
  same way, for the same reason. */
194
- --table-rule-plated: color-mix(in oklab, currentColor 20%, transparent);
195
- --table-rule-tone: color-mix(
194
+ --_table-rule-plated: color-mix(in oklab, currentColor 20%, transparent);
195
+ --_table-rule-tone: color-mix(
196
196
  in oklab,
197
- var(--table-rule-plated) var(--ui-fill, var(--_d-fill)),
197
+ var(--_table-rule-plated) var(--ui-fill, var(--_d-fill)),
198
198
  var(--intent-border, var(--ui-rule-ink, var(--ui-ink, var(--color-border))))
199
199
  );
200
- --table-rule: color-mix(in oklab, var(--table-rule-tone) var(--table-rule-amount), transparent);
201
- --table-boundary: color-mix(in oklab, var(--table-rule-tone) var(--table-boundary-amount), transparent);
200
+ --_table-rule: color-mix(in oklab, var(--_table-rule-tone) var(--_table-rule-amount), transparent);
201
+ --_table-boundary: color-mix(in oklab, var(--_table-rule-tone) var(--_table-boundary-amount), transparent);
202
202
  /* A hovered row is a step from the table it is in, not from a tone the page
203
203
  happens to own. A translucent step is relative at every fill, the way
204
204
  `box-hover` is: the row composites onto whatever plate the table drew, so a
@@ -216,9 +216,12 @@
216
216
  already carries and therefore always contrasts with it.
217
217
 
218
218
  Both ends are leaves, and the step lands on `transparent` rather than on
219
- `--_bg`, for the reason `--table-rule-plated` above gives. */
220
- --table-hover-tone: color-mix(in oklab, currentColor var(--ui-fill, var(--_d-fill)), var(--intent-hover));
221
- --table-row-hover: color-mix(in oklab, var(--table-hover-tone) 12%, transparent);
219
+ `--_bg`, for the reason `--_table-rule-plated` above gives. */
220
+ --_table-hover-tone: color-mix(in oklab, currentColor var(--ui-fill, var(--_d-fill)), var(--intent-hover));
221
+ /* The default hover. `--table-hover` is public and read where the row
222
+ paints, not here, so a value on any ancestor of the cells reaches them,
223
+ a `tbody` or row included; `transparent` turns the hover off. */
224
+ --_table-row-hover: color-mix(in oklab, var(--_table-hover-tone) 12%, transparent);
222
225
 
223
226
  border-spacing: 0;
224
227
 
@@ -284,11 +287,11 @@
284
287
  corner cells round it: a section's background ignores the cells' corners. */
285
288
  & thead,
286
289
  & tfoot {
287
- color: var(--table-head-fg);
290
+ color: var(--_table-head-fg);
288
291
  }
289
292
 
290
293
  & :is(thead, tfoot) > tr > * {
291
- background-color: var(--table-head-bg);
294
+ background-color: var(--_table-head-bg);
292
295
  }
293
296
 
294
297
  /* Every cell carries the hairline; what varies is whether it is painted. The
@@ -309,13 +312,19 @@
309
312
  initial value, which counts as naming none. */
310
313
  --_table-rule-width: var(--ui-border-width, var(--border-width));
311
314
  /* In `:where()`: these are the cells' defaults, and at the 0-1-1 the plain
312
- selector carried, `p-0` or `text-center` on a cell lost to them. */
315
+ selector carried, `p-0` or `text-center` on a cell lost to them.
316
+ `--table-cell-padding` is public and read with the default, `py-3 px-4`,
317
+ as its fallback. A physical `padding`, because one variable has to carry
318
+ both axes: in a vertical writing mode its two values stay top-bottom and
319
+ left-right rather than following the block and inline axes. */
313
320
  :where(& :is(th, td)) {
314
- @apply px-4 py-3 text-start align-top;
321
+ @apply text-start align-top;
322
+
323
+ padding: var(--table-cell-padding, calc(var(--spacing) * 3) calc(var(--spacing) * 4));
315
324
 
316
325
  border-bottom-style: var(--ui-rule-style, var(--ui-line-style, solid));
317
326
  border-bottom-width: var(--_table-rule-width);
318
- border-color: var(--table-rule);
327
+ border-color: var(--_table-rule);
319
328
  }
320
329
 
321
330
  /* The two lines that separate the parts of a table from each other: under the
@@ -328,13 +337,13 @@
328
337
  because with rules off that row paints nothing. Stated on the foot, the
329
338
  boundary holds at every setting. */
330
339
  & thead tr:last-child > * {
331
- border-bottom-color: var(--table-boundary);
340
+ border-bottom-color: var(--_table-boundary);
332
341
  }
333
342
 
334
343
  & tfoot tr:first-child > * {
335
344
  border-top-style: var(--ui-rule-style, var(--ui-line-style, solid));
336
345
  border-top-width: var(--_table-rule-width);
337
- border-top-color: var(--table-boundary);
346
+ border-top-color: var(--_table-boundary);
338
347
  }
339
348
 
340
349
  :where(& th) {
@@ -356,14 +365,14 @@
356
365
  the same values, but a `color` declared on every row would override a
357
366
  colour a consumer set on the table. */
358
367
  & tbody tr:is(.neutral, .primary, .secondary, .success, .warning, .destructive, .info) {
359
- --table-rule-tone: color-mix(
368
+ --_table-rule-tone: color-mix(
360
369
  in oklab,
361
- var(--table-rule-plated) var(--ui-fill, var(--_d-fill)),
370
+ var(--_table-rule-plated) var(--ui-fill, var(--_d-fill)),
362
371
  var(--intent-border)
363
372
  );
364
- --table-rule: color-mix(in oklab, var(--table-rule-tone) var(--table-rule-amount), transparent);
365
- --table-hover-tone: color-mix(in oklab, currentColor var(--ui-fill, var(--_d-fill)), var(--intent-hover));
366
- --table-row-hover: color-mix(in oklab, var(--table-hover-tone) 12%, transparent);
373
+ --_table-rule: color-mix(in oklab, var(--_table-rule-tone) var(--_table-rule-amount), transparent);
374
+ --_table-hover-tone: color-mix(in oklab, currentColor var(--ui-fill, var(--_d-fill)), var(--intent-hover));
375
+ --_table-row-hover: color-mix(in oklab, var(--_table-hover-tone) 12%, transparent);
367
376
 
368
377
  /* A neutral solid table caps its fill at 20%, so its plate is a light grey
369
378
  and the ramp keeps `--_on-fill` low: the row's ink is then mostly the
@@ -387,9 +396,12 @@
387
396
  }
388
397
 
389
398
  /* On the cells, for the reason the head's plate is: a hovered last row keeps
390
- the table's bottom corners. */
391
- & tbody tr:hover > * {
392
- background-color: var(--table-row-hover);
399
+ the table's bottom corners. Behind the query `box-hover` is, so a tapped
400
+ row does not stay tinted. */
401
+ @media (hover: hover) {
402
+ & tbody tr:hover > * {
403
+ background-color: var(--table-hover, var(--_table-row-hover));
404
+ }
393
405
  }
394
406
 
395
407
  /* The rule comes off the row that is visually last, which is not always the
@@ -607,19 +619,25 @@
607
619
  --_d-fg-on-fill: 0%;
608
620
  --_d-border: 100%;
609
621
  --_d-elevation: 0;
622
+
623
+ /* Printed as drawn, as `box` is. A browser leaves backgrounds off paper by
624
+ default, and a filled quotation prints its text in the contrast colour:
625
+ white on nothing. */
626
+ print-color-adjust: exact;
627
+
610
628
  /* Presentation capped by the intent, the same `--_capped` `box` composes, kept
611
- separate from `--quote-fill` because the ink ramp below reads it before
629
+ separate from `--_quote-fill` because the ink ramp below reads it before
612
630
  `--ui-bg-alpha` thins it. */
613
- --quote-capped: min(var(--ui-fill, var(--_d-fill)), var(--intent-fill-max, 100%));
614
- --quote-fill: calc(var(--quote-capped) * var(--ui-bg-alpha, 1));
631
+ --_quote-capped: min(var(--ui-fill, var(--_d-fill)), var(--intent-fill-max, 100%));
632
+ --_quote-fill: calc(var(--_quote-capped) * var(--ui-bg-alpha, 1));
615
633
  /* `box`'s `--_plate`: a fill the intent's cap stopped short rests on the page
616
634
  background, so a neutral `.solid` quotation is a plate rather than a tint
617
635
  of whatever is behind it. */
618
- --quote-plate: clamp(0%, calc((var(--ui-fill, var(--_d-fill)) - var(--quote-capped)) * 1000), 100%);
619
- --quote-bg: color-mix(
636
+ --_quote-plate: clamp(0%, calc((var(--ui-fill, var(--_d-fill)) - var(--_quote-capped)) * 1000), 100%);
637
+ --_quote-bg: color-mix(
620
638
  in oklab,
621
- var(--intent-color) var(--quote-fill),
622
- color-mix(in oklab, var(--color-background) var(--quote-plate), transparent)
639
+ var(--intent-color) var(--_quote-fill),
640
+ color-mix(in oklab, var(--color-background) var(--_quote-plate), transparent)
623
641
  );
624
642
  /* The same edge blend `box` draws, in the same order and for the same reason:
625
643
  the blend is the line's colour, and how much line there is comes after it.
@@ -633,19 +651,21 @@
633
651
  A quotation draws its own edge instead of taking `box`'s, so an edge change
634
652
  is made in `box`, `.quote`, and `.progress`. Recorded in `registry.json`
635
653
  beside the decision to compose none of `box`. */
636
- --quote-line: color-mix(
654
+ --_quote-line: color-mix(
637
655
  in oklab,
638
656
  transparent var(--ui-fill, var(--_d-fill)),
639
657
  var(--intent-border, var(--ui-ink, var(--color-border)))
640
658
  );
641
- --quote-edge: color-mix(in oklab, var(--quote-line) var(--ui-border, var(--_d-border)), transparent);
642
- --quote-width: calc(var(--ui-border-width, var(--border-width)) * 2 + 1px);
659
+ --_quote-edge: color-mix(in oklab, var(--_quote-line) var(--ui-border, var(--_d-border)), transparent);
660
+ /* Public, read with its default, so a value set on any ancestor reaches the
661
+ bar. */
662
+ --_quote-width: var(--quote-width, calc(var(--ui-border-width, var(--border-width)) * 2 + 1px));
643
663
 
644
664
  @apply my-0 border-s py-2 ps-4 italic;
645
665
 
646
- background-color: var(--quote-bg);
647
- border-inline-start-color: var(--quote-edge);
648
- border-inline-start-width: var(--quote-width);
666
+ background-color: var(--_quote-bg);
667
+ border-inline-start-color: var(--_quote-edge);
668
+ border-inline-start-width: var(--_quote-width);
649
669
  /* The ink is gated by the plate, not tied to the fill: `--ui-fg-on-fill` is
650
670
  the ceiling, and the contrast tone only ramps in past a half fill, reaching
651
671
  full at a full fill. Below that the ink stays `--intent-strong`, the tone
@@ -655,7 +675,7 @@
655
675
  color: color-mix(
656
676
  in oklab,
657
677
  var(--intent-contrast)
658
- min(var(--ui-fg-on-fill, var(--_d-fg-on-fill)), max(0%, calc(var(--quote-capped) * 2 - 100%))),
678
+ min(var(--ui-fg-on-fill, var(--_d-fg-on-fill)), max(0%, calc(var(--_quote-capped) * 2 - 100%))),
659
679
  var(--intent-strong)
660
680
  );
661
681
 
@@ -157,8 +157,10 @@
157
157
  }
158
158
  }
159
159
 
160
- --divider-color: var(--intent-color);
161
- --divider-width: var(--ui-border-width, var(--border-width));
160
+ /* Public, read with their defaults, so a value set on any ancestor reaches
161
+ the line. The colour stands in front of the intent. */
162
+ --_divider-color: var(--divider-color, var(--intent-color));
163
+ --_divider-width: var(--divider-width, var(--ui-border-width, var(--border-width)));
162
164
 
163
165
  @apply m-0 border-0;
164
166
 
@@ -166,13 +168,13 @@
166
168
  and stretches it down its row. */
167
169
  --_vertical-width: var(--_m-vertical) 0px;
168
170
  --_vertical-self: var(--_m-vertical) stretch;
169
- --_vertical-line: var(--_m-vertical) var(--divider-width);
171
+ --_vertical-line: var(--_m-vertical) var(--_divider-width);
170
172
 
171
173
  width: var(--_vertical-width, 100%);
172
174
  align-self: var(--_vertical-self, auto);
173
- border-color: var(--divider-color);
175
+ border-color: var(--_divider-color);
174
176
  border-style: var(--ui-rule-style, var(--ui-line-style, solid));
175
- border-top-width: var(--_vertical-width, var(--divider-width));
177
+ border-top-width: var(--_vertical-width, var(--_divider-width));
176
178
  border-inline-start-width: var(--_vertical-line, 0px);
177
179
  }
178
180