@codenhub/styles 0.5.0 → 0.7.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 (119) hide show
  1. package/NOTICE +18 -16
  2. package/README.es.md +61 -0
  3. package/README.md +27 -22
  4. package/README.pt-BR.md +61 -0
  5. package/dist/aesthetics/chunky-tile.css +1 -1
  6. package/dist/aesthetics/cyber.css +1 -1
  7. package/dist/aesthetics/glass.css +1 -1
  8. package/dist/aesthetics/index.css +2 -2
  9. package/dist/aesthetics/neobrutalism.css +1 -1
  10. package/dist/aesthetics/pixel.css +1 -1
  11. package/dist/aesthetics/sketch.css +1 -1
  12. package/dist/components.css +2 -2
  13. package/dist/index.css +2 -2
  14. package/dist/native.css +2 -2
  15. package/dist/palette.css +1 -1
  16. package/dist/theme.css +2 -2
  17. package/dist/tw/aesthetics/chunky-tile.css +120 -62
  18. package/dist/tw/aesthetics/cyber.css +102 -40
  19. package/dist/tw/aesthetics/glass.css +371 -19
  20. package/dist/tw/aesthetics/index.css +2 -1
  21. package/dist/tw/aesthetics/neobrutalism.css +121 -33
  22. package/dist/tw/aesthetics/pixel.css +111 -16
  23. package/dist/tw/aesthetics/sketch.css +100 -28
  24. package/dist/tw/box.css +69 -28
  25. package/dist/tw/components/button.css +35 -14
  26. package/dist/tw/components/feedback.css +61 -58
  27. package/dist/tw/components/form.css +255 -142
  28. package/dist/tw/components/index.css +4 -9
  29. package/dist/tw/components/surface.css +80 -68
  30. package/dist/tw/components/tooltip.css +75 -41
  31. package/dist/tw/elevation.css +14 -22
  32. package/dist/tw/index.css +15 -19
  33. package/dist/tw/intent.css +35 -27
  34. package/dist/tw/native.css +22 -12
  35. package/dist/tw/palette.css +14 -11
  36. package/dist/tw/presentation.css +16 -30
  37. package/dist/tw/reset.css +36 -43
  38. package/dist/tw/surface.css +11 -12
  39. package/dist/tw/theme.css +87 -103
  40. package/dist/tw/utilities/content.css +311 -200
  41. package/dist/tw/utilities/layout.css +41 -37
  42. package/docs/accessibility.md +104 -58
  43. package/docs/changelog/0.1.1.md +1 -0
  44. package/docs/changelog/0.2.0.md +1 -0
  45. package/docs/changelog/0.3.0.md +1 -0
  46. package/docs/changelog/0.4.0.md +1 -0
  47. package/docs/changelog/0.5.0.md +8 -3
  48. package/docs/changelog/0.6.0.md +53 -0
  49. package/docs/changelog/0.7.0.md +50 -0
  50. package/docs/changelog/index.md +2 -0
  51. package/docs/concepts.md +188 -46
  52. package/docs/es/accessibility.md +150 -0
  53. package/docs/es/concepts.md +212 -0
  54. package/docs/es/index.md +104 -0
  55. package/docs/es/integrating/astro.md +35 -0
  56. package/docs/es/integrating/index.md +47 -0
  57. package/docs/es/integrating/nextjs.md +67 -0
  58. package/docs/es/integrating/svelte.md +45 -0
  59. package/docs/es/integrating/tailwind.md +78 -0
  60. package/docs/es/integrating/vue.md +31 -0
  61. package/docs/es/integrating/without-a-bundler.md +115 -0
  62. package/docs/es/setup.md +180 -0
  63. package/docs/es/usage/aesthetics.md +276 -0
  64. package/docs/es/usage/buttons.md +131 -0
  65. package/docs/es/usage/composing.md +164 -0
  66. package/docs/es/usage/content-and-layout.md +215 -0
  67. package/docs/es/usage/customizing.md +298 -0
  68. package/docs/es/usage/feedback.md +153 -0
  69. package/docs/es/usage/forms.md +231 -0
  70. package/docs/es/usage/index.md +29 -0
  71. package/docs/es/usage/solo.md +84 -0
  72. package/docs/es/usage/theming.md +296 -0
  73. package/docs/es/usage/tooltips.md +127 -0
  74. package/docs/index.md +89 -21
  75. package/docs/integrating/astro.md +3 -4
  76. package/docs/integrating/index.md +18 -13
  77. package/docs/integrating/nextjs.md +4 -5
  78. package/docs/integrating/svelte.md +5 -4
  79. package/docs/integrating/tailwind.md +29 -8
  80. package/docs/integrating/vue.md +3 -4
  81. package/docs/integrating/without-a-bundler.md +114 -0
  82. package/docs/pt-BR/accessibility.md +150 -0
  83. package/docs/pt-BR/concepts.md +212 -0
  84. package/docs/pt-BR/index.md +104 -0
  85. package/docs/pt-BR/integrating/astro.md +35 -0
  86. package/docs/pt-BR/integrating/index.md +47 -0
  87. package/docs/pt-BR/integrating/nextjs.md +67 -0
  88. package/docs/pt-BR/integrating/svelte.md +45 -0
  89. package/docs/pt-BR/integrating/tailwind.md +78 -0
  90. package/docs/pt-BR/integrating/vue.md +31 -0
  91. package/docs/pt-BR/integrating/without-a-bundler.md +115 -0
  92. package/docs/pt-BR/setup.md +180 -0
  93. package/docs/pt-BR/usage/aesthetics.md +276 -0
  94. package/docs/pt-BR/usage/buttons.md +131 -0
  95. package/docs/pt-BR/usage/composing.md +164 -0
  96. package/docs/pt-BR/usage/content-and-layout.md +215 -0
  97. package/docs/pt-BR/usage/customizing.md +298 -0
  98. package/docs/pt-BR/usage/feedback.md +153 -0
  99. package/docs/pt-BR/usage/forms.md +231 -0
  100. package/docs/pt-BR/usage/index.md +29 -0
  101. package/docs/pt-BR/usage/solo.md +84 -0
  102. package/docs/pt-BR/usage/theming.md +296 -0
  103. package/docs/pt-BR/usage/tooltips.md +127 -0
  104. package/docs/setup.md +134 -91
  105. package/docs/usage/aesthetics.md +102 -65
  106. package/docs/usage/buttons.md +108 -40
  107. package/docs/usage/composing.md +105 -92
  108. package/docs/usage/content-and-layout.md +159 -127
  109. package/docs/usage/customizing.md +112 -43
  110. package/docs/usage/feedback.md +135 -70
  111. package/docs/usage/forms.md +184 -99
  112. package/docs/usage/index.md +18 -14
  113. package/docs/usage/solo.md +83 -0
  114. package/docs/usage/theming.md +260 -119
  115. package/docs/usage/tooltips.md +103 -42
  116. package/llms-full.txt +2465 -1272
  117. package/llms.txt +25 -17
  118. package/package.json +28 -35
  119. package/dist/tw/components/loader.css +0 -117
@@ -5,7 +5,7 @@
5
5
  every outer shadow, so a clipped chamfer has nothing left to glow, and an
6
6
  inset ring cannot follow a diagonal cut the way `.pixel`'s follows its square
7
7
  one. `corner-shape` draws the corner itself, and the border, the glow, and the
8
- focus outline all follow it. Load after the base stylesheet. */
8
+ focus outline all follow it. */
9
9
 
10
10
  /* The layer map, stated before anything uses a layer -- see `theme.css`. The
11
11
  aesthetic's token class sits in `components`, below every utility, so a
@@ -26,13 +26,11 @@
26
26
 
27
27
  The cut is the corner length at scale 1, and `box` multiplies it by the
28
28
  size step, so a `.p-xs` icon button takes half the cut and a `.lg` button
29
- a quarter more -- always a true 45 degrees, because it stays a length. It
30
- used to be capped at a quarter of the element's box, a percentage, which
31
- ran shallower than 45 degrees on a small wide button; the step retired
32
- the cap. A shape set through a knob is taken as written, unscaled: it is
33
- read as `--ui-radius`, which `box` honours over the computed corner, and
34
- left unset the reference makes the token guaranteed-invalid so the
35
- computed corner draws. */
29
+ a quarter more -- always a true 45 degrees, because it stays a length. A
30
+ shape set through a knob is taken as written, unscaled: it is read as
31
+ `--ui-radius`, which `box` honours over the computed corner, and left
32
+ unset the reference makes the token guaranteed-invalid so the computed
33
+ corner draws. */
36
34
  --_cyber-cut: var(--cyber-cut, 0.625rem);
37
35
  --_cyber-glow: var(--cyber-glow, 8px);
38
36
 
@@ -69,10 +67,15 @@
69
67
  --ui-rule-style: initial;
70
68
 
71
69
  /* The glow is light, not depth, so it is the halo: the component's own intent
72
- colour at 40%, blurred, with no offset. Elevation does not scale it, so
73
- every component glows -- fields and chips included -- and `.flat` does
74
- not put it out. There is no depth, and the transparent depth colour keeps
75
- `.raised` and `.floating` from drawing any. */
70
+ colour at 60%, blurred, with no offset. The 1px spread and the 60% put
71
+ the brightest point on the outline: at 40% with no spread the halo
72
+ peaked at about a fifth of the ink just outside the box, brighter than a
73
+ soft or capped neutral fill, so an edgeless element read as something in
74
+ front of a light -- a shadow -- rather than the light. An edged element
75
+ has its line for a source and read as lit either way. Elevation does
76
+ not scale it, so every component glows -- fields and chips included --
77
+ and `.flat` does not put it out. There is no depth, and the transparent
78
+ depth colour keeps `.raised` and `.floating` from drawing any. */
76
79
  --elevation-color: transparent;
77
80
  --ui-shadow-ink: 0%;
78
81
  --ui-shadow-x: 0px;
@@ -80,8 +83,8 @@
80
83
  --ui-shadow-blur: 0px;
81
84
  --ui-shadow-spread: 0px;
82
85
  --ui-halo-blur: var(--_cyber-glow);
83
- --ui-halo-spread: 0px;
84
- --ui-halo-ink: 40%;
86
+ --ui-halo-spread: 1px;
87
+ --ui-halo-ink: 60%;
85
88
 
86
89
  /* The glow holds still under the pointer and under a press; the press is the
87
90
  base scale, restated because a region nested inside another aesthetic must
@@ -100,6 +103,9 @@
100
103
  --ui-clip-tight: none;
101
104
  --ui-shadow-inset: ;
102
105
  --ui-shadow-edge: initial;
106
+ /* The bevel is a corner shape, not a clip, so the global focus outline
107
+ follows it; pixel's inset focus layer is cleared rather than inherited. */
108
+ --ui-focus-inset: initial;
103
109
  --ui-backdrop: none;
104
110
  --ui-surface-ground: initial;
105
111
  --ui-surface-shadow: initial;
@@ -111,9 +117,13 @@
111
117
  platform already has. */
112
118
  font-family: var(--font-cyber, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
113
119
 
114
- /* The control ink glass and chunky tile name, cleared so a region nested
115
- inside either draws its controls in this aesthetic's own ink. */
116
- --ui-control-ink: initial;
120
+ /* A control's neutral line is the theme's control border, not this
121
+ aesthetic's ink: that ink is the primary colour in both themes, so every
122
+ unchecked toggle and resting field drew its boundary as loudly as a
123
+ primary one. Named rather than cleared, so a region nested inside glass
124
+ or chunky tile does not inherit theirs either. */
125
+ --ui-control-ink: var(--color-control-border);
126
+ --ui-rule-ink: initial;
117
127
 
118
128
  /* Chunky tile's heavier label, cleared so a region nested inside it keeps
119
129
  the button's and the badge's own label. */
@@ -145,16 +155,37 @@
145
155
 
146
156
  /* Solo: the same look painted onto the one element carrying the class, for an
147
157
  element the package does not style. See docs/internal/model.md#solo-classes and
148
- the note on `.glass-solo`: own knobs and foundation tokens with literal
149
- fallbacks, never a shared `--ui-*`, `--intent-*`, or `--elevation-color`
150
- token, unlayered, and not for this package's own components. */
158
+ the note on `.glass-solo`: it composes with the element's presentation,
159
+ intent, and elevation, and reads its material from its own knobs and
160
+ foundation tokens with literal fallbacks, never a shared material `--ui-*`
161
+ or `--elevation-color` token. Unlayered, and not for this package's own
162
+ components. */
151
163
  .cyber-solo {
152
- --_cyber-ink: var(
153
- --cyber-ink,
154
- light-dark(var(--color-neutral-950, oklch(14.5% 0 0)), var(--color-neutral-50, oklch(98.5% 0 0)))
164
+ /* The composition, the same in every solo class; `registry.test.ts` holds
165
+ the copies together. See the note on `.glass-solo`. */
166
+ --_solo-intent-color: initial;
167
+ --_solo-intent-contrast: initial;
168
+ --_solo-intent-strong: initial;
169
+ --_solo-intent-border: initial;
170
+ --_solo-intent-fill-max: initial;
171
+ --_solo-color: var(--_solo-intent-color, var(--color-text, light-dark(oklch(14.5% 0 0), oklch(98.5% 0 0))));
172
+ --_solo-contrast: var(
173
+ --_solo-intent-contrast,
174
+ var(--color-text-contrast, light-dark(oklch(98.5% 0 0), oklch(14.5% 0 0)))
155
175
  );
176
+ --_solo-strong: var(--_solo-intent-strong, var(--color-text-strong, light-dark(oklch(20.5% 0 0), oklch(97% 0 0))));
177
+ --_solo-capped: min(var(--ui-fill, 0%), var(--_solo-intent-fill-max, 20%));
178
+ --_solo-fill: color-mix(in oklab, var(--_solo-color) var(--_solo-capped), transparent);
179
+ --_solo-on-fill: min(var(--ui-fg-on-fill, 0%), max(0%, calc(var(--_solo-capped) * 2 - 100%)));
180
+ --_solo-fg: color-mix(in oklab, var(--_solo-contrast) var(--_solo-on-fill), var(--_solo-strong));
181
+ /* The line with no intent on the element: this aesthetic's own ink. */
182
+ --_solo-ink: var(
183
+ --_solo-intent-border,
184
+ var(--cyber-ink, light-dark(var(--color-neutral-950, oklch(14.5% 0 0)), var(--color-neutral-50, oklch(98.5% 0 0))))
185
+ );
186
+ --_solo-edge: color-mix(in oklab, var(--_solo-ink) var(--ui-border, 100%), var(--_solo-fill));
156
187
 
157
- border: 1px solid var(--_cyber-ink);
188
+ border: 1px solid var(--_solo-edge);
158
189
  /* The surface shape: the element this exists for is usually a pane. An action
159
190
  takes the control shape below. */
160
191
  border-radius: var(
@@ -162,13 +193,44 @@
162
193
  0 min(var(--cyber-cut, 0.625rem), 25%) / 0 min(var(--cyber-cut, 0.625rem), 25%)
163
194
  );
164
195
  corner-shape: bevel;
165
- /* Always lit: the elevation gate the aesthetic class answers to is `box`'s,
166
- and a solo element is one the consumer chose to light up. */
167
- box-shadow: 0 0 var(--cyber-glow, 8px) 0 color-mix(in oklab, var(--_cyber-ink) 40%, transparent);
196
+ /* Always lit, in the element's own colour: the glow is a halo and not depth,
197
+ so `.flat` leaves it on, as under the aesthetic class. */
198
+ box-shadow:
199
+ 0 0 var(--cyber-glow, 8px) 1px color-mix(in oklab, var(--_solo-ink) 60%, transparent),
200
+ inset 0 0 0 100vmax var(--_solo-fill);
168
201
  font-family: var(--font-cyber, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
169
202
  transition: transform var(--motion-duration-normal, 200ms) var(--motion-ease, cubic-bezier(0.2, 0, 0, 1));
170
203
  }
171
204
 
205
+ /* An intent class on the element colours it, as on a component. Named rather
206
+ than read from `--intent-*` alone: those slots inherit, so a `.success`
207
+ container would colour a solo element where it leaves a component neutral. */
208
+ .cyber-solo:is(.primary, .secondary, .success, .warning, .destructive, .info) {
209
+ --_solo-intent-color: var(--intent-color);
210
+ --_solo-intent-contrast: var(--intent-contrast);
211
+ --_solo-intent-strong: var(--intent-strong);
212
+ --_solo-intent-border: var(--intent-border);
213
+ --_solo-intent-fill-max: var(--intent-fill-max);
214
+ }
215
+
216
+ /* The text colour is written only where a fill or an intent is asked for, on
217
+ the element or by a container's fill class. Anywhere else the element keeps
218
+ its own: a dark toast keeps its light text. */
219
+ .cyber-solo:is(
220
+ .solid,
221
+ .soft,
222
+ .ghost,
223
+ .primary,
224
+ .secondary,
225
+ .success,
226
+ .warning,
227
+ .destructive,
228
+ .info,
229
+ :is(.solid, .soft, .ghost) *
230
+ ) {
231
+ color: var(--_solo-fg);
232
+ }
233
+
172
234
  /* An action takes the control shape, on the opposite diagonal to a pane's. */
173
235
  .cyber-solo:is(
174
236
  button,
@@ -201,19 +263,6 @@
201
263
  container stays put, the way only `.btn` and an opted-in card press under
202
264
  the aesthetic class. */
203
265
  .cyber-solo:is(
204
- button,
205
- a[href],
206
- [role="button"],
207
- summary,
208
- input[type="button"],
209
- input[type="submit"],
210
- input[type="reset"]
211
- ):active:not(:disabled, [aria-disabled="true"]) {
212
- transform: scale(0.97);
213
- }
214
-
215
- @media (prefers-reduced-motion: reduce) {
216
- .cyber-solo:is(
217
266
  button,
218
267
  a[href],
219
268
  [role="button"],
@@ -222,6 +271,19 @@
222
271
  input[type="submit"],
223
272
  input[type="reset"]
224
273
  ):active:not(:disabled, [aria-disabled="true"]) {
274
+ transform: scale(0.97);
275
+ }
276
+
277
+ @media (prefers-reduced-motion: reduce) {
278
+ .cyber-solo:is(
279
+ button,
280
+ a[href],
281
+ [role="button"],
282
+ summary,
283
+ input[type="button"],
284
+ input[type="submit"],
285
+ input[type="reset"]
286
+ ):active:not(:disabled, [aria-disabled="true"]) {
225
287
  transform: none;
226
288
  }
227
289
  }