@codenhub/styles 0.6.0 → 0.8.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 (151) hide show
  1. package/NOTICE +18 -16
  2. package/README.es.md +62 -0
  3. package/README.md +28 -22
  4. package/README.pt-BR.md +62 -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/cli.js +189 -0
  13. package/dist/components.css +2 -2
  14. package/dist/index.css +2 -2
  15. package/dist/index.d.ts +1 -0
  16. package/dist/native.css +2 -2
  17. package/dist/palette.css +1 -1
  18. package/dist/theme.css +2 -2
  19. package/docs/accessibility.md +108 -60
  20. package/docs/changelog/0.1.1.md +1 -0
  21. package/docs/changelog/0.2.0.md +1 -0
  22. package/docs/changelog/0.3.0.md +1 -0
  23. package/docs/changelog/0.4.0.md +1 -0
  24. package/docs/changelog/0.5.0.md +8 -3
  25. package/docs/changelog/0.6.0.md +2 -1
  26. package/docs/changelog/0.7.0.md +50 -0
  27. package/docs/changelog/0.8.0.md +70 -0
  28. package/docs/changelog/index.md +2 -0
  29. package/docs/concepts.md +188 -46
  30. package/docs/es/accessibility.md +169 -0
  31. package/docs/es/concepts.md +212 -0
  32. package/docs/es/index.md +105 -0
  33. package/docs/es/integrating/astro.md +35 -0
  34. package/docs/es/integrating/index.md +75 -0
  35. package/docs/es/integrating/nextjs.md +67 -0
  36. package/docs/es/integrating/svelte.md +45 -0
  37. package/docs/es/integrating/tailwind.md +148 -0
  38. package/docs/es/integrating/vue.md +31 -0
  39. package/docs/es/integrating/without-a-bundler.md +238 -0
  40. package/docs/es/setup.md +188 -0
  41. package/docs/es/usage/aesthetics.md +282 -0
  42. package/docs/es/usage/buttons.md +135 -0
  43. package/docs/es/usage/composing.md +168 -0
  44. package/docs/es/usage/content-and-layout.md +219 -0
  45. package/docs/es/usage/customizing.md +304 -0
  46. package/docs/es/usage/feedback.md +157 -0
  47. package/docs/es/usage/forms.md +256 -0
  48. package/docs/es/usage/index.md +33 -0
  49. package/docs/es/usage/presets.md +92 -0
  50. package/docs/es/usage/solo.md +86 -0
  51. package/docs/es/usage/theming.md +309 -0
  52. package/docs/es/usage/tooltips.md +127 -0
  53. package/docs/index.md +86 -26
  54. package/docs/integrating/astro.md +3 -4
  55. package/docs/integrating/index.md +46 -13
  56. package/docs/integrating/nextjs.md +3 -4
  57. package/docs/integrating/svelte.md +5 -4
  58. package/docs/integrating/tailwind.md +89 -6
  59. package/docs/integrating/vue.md +3 -4
  60. package/docs/integrating/without-a-bundler.md +237 -0
  61. package/docs/pt-BR/accessibility.md +169 -0
  62. package/docs/pt-BR/concepts.md +212 -0
  63. package/docs/pt-BR/index.md +105 -0
  64. package/docs/pt-BR/integrating/astro.md +35 -0
  65. package/docs/pt-BR/integrating/index.md +75 -0
  66. package/docs/pt-BR/integrating/nextjs.md +67 -0
  67. package/docs/pt-BR/integrating/svelte.md +45 -0
  68. package/docs/pt-BR/integrating/tailwind.md +148 -0
  69. package/docs/pt-BR/integrating/vue.md +31 -0
  70. package/docs/pt-BR/integrating/without-a-bundler.md +238 -0
  71. package/docs/pt-BR/setup.md +188 -0
  72. package/docs/pt-BR/usage/aesthetics.md +282 -0
  73. package/docs/pt-BR/usage/buttons.md +135 -0
  74. package/docs/pt-BR/usage/composing.md +168 -0
  75. package/docs/pt-BR/usage/content-and-layout.md +219 -0
  76. package/docs/pt-BR/usage/customizing.md +304 -0
  77. package/docs/pt-BR/usage/feedback.md +157 -0
  78. package/docs/pt-BR/usage/forms.md +256 -0
  79. package/docs/pt-BR/usage/index.md +33 -0
  80. package/docs/pt-BR/usage/presets.md +92 -0
  81. package/docs/pt-BR/usage/solo.md +86 -0
  82. package/docs/pt-BR/usage/theming.md +309 -0
  83. package/docs/pt-BR/usage/tooltips.md +127 -0
  84. package/docs/setup.md +142 -91
  85. package/docs/usage/aesthetics.md +89 -73
  86. package/docs/usage/buttons.md +112 -40
  87. package/docs/usage/composing.md +109 -92
  88. package/docs/usage/content-and-layout.md +160 -125
  89. package/docs/usage/customizing.md +117 -41
  90. package/docs/usage/feedback.md +138 -71
  91. package/docs/usage/forms.md +201 -107
  92. package/docs/usage/index.md +22 -14
  93. package/docs/usage/presets.md +91 -0
  94. package/docs/usage/solo.md +85 -0
  95. package/docs/usage/theming.md +273 -118
  96. package/docs/usage/tooltips.md +90 -49
  97. package/llms-full.txt +2820 -1298
  98. package/llms.txt +24 -22
  99. package/package.json +134 -91
  100. package/{dist/tw → tw}/aesthetics/chunky-tile.css +107 -29
  101. package/{dist/tw → tw}/aesthetics/cyber.css +88 -40
  102. package/{dist/tw → tw}/aesthetics/glass.css +257 -61
  103. package/{dist/tw → tw}/aesthetics/neobrutalism.css +113 -20
  104. package/{dist/tw → tw}/aesthetics/pixel.css +93 -8
  105. package/tw/aesthetics/sketch.css +417 -0
  106. package/{dist/tw → tw}/box.css +105 -9
  107. package/tw/components/button.css +11 -0
  108. package/tw/components/button.rules.css +187 -0
  109. package/tw/components/feedback.css +11 -0
  110. package/{dist/tw/components/feedback.css → tw/components/feedback.rules.css} +136 -32
  111. package/tw/components/form.css +11 -0
  112. package/{dist/tw/components/form.css → tw/components/form.rules.css} +577 -125
  113. package/tw/components/index.css +16 -0
  114. package/tw/components/rules.css +41 -0
  115. package/tw/components/surface.css +11 -0
  116. package/tw/components/surface.rules.css +222 -0
  117. package/tw/components/tooltip.css +11 -0
  118. package/{dist/tw/components/tooltip.css → tw/components/tooltip.rules.css} +43 -27
  119. package/{dist/tw → tw}/corner.css +18 -12
  120. package/{dist/tw → tw}/elevation.css +23 -17
  121. package/{dist/tw → tw}/index.css +12 -10
  122. package/tw/index.d.ts +1 -0
  123. package/tw/intent.css +312 -0
  124. package/tw/modifiers.css +127 -0
  125. package/tw/native.css +320 -0
  126. package/tw/presentation.css +139 -0
  127. package/tw/reset.css +10 -0
  128. package/{dist/tw/reset.css → tw/reset.rules.css} +21 -22
  129. package/tw/size.css +34 -0
  130. package/tw/surface.css +9 -0
  131. package/tw/surface.rules.css +212 -0
  132. package/{dist/tw → tw}/theme.css +121 -45
  133. package/tw/typography.css +8 -0
  134. package/{dist/tw/typography.css → tw/typography.rules.css} +0 -3
  135. package/{dist/tw → tw}/utilities/content.css +212 -50
  136. package/tw/utilities/index.css +11 -0
  137. package/tw/utilities/layout.css +208 -0
  138. package/tw/utilities/rules.css +8 -0
  139. package/dist/tw/aesthetics/sketch.css +0 -333
  140. package/dist/tw/components/button.css +0 -139
  141. package/dist/tw/components/index.css +0 -36
  142. package/dist/tw/components/loader.css +0 -116
  143. package/dist/tw/components/surface.css +0 -175
  144. package/dist/tw/intent.css +0 -228
  145. package/dist/tw/native.css +0 -203
  146. package/dist/tw/palette.css +0 -460
  147. package/dist/tw/presentation.css +0 -68
  148. package/dist/tw/surface.css +0 -61
  149. package/dist/tw/utilities/index.css +0 -6
  150. package/dist/tw/utilities/layout.css +0 -130
  151. /package/{dist/tw → tw}/aesthetics/index.css +0 -0
@@ -1,333 +0,0 @@
1
- /* Sketch: uneven elliptical corners, a solid ink edge, and a small hard shadow.
2
- The handwriting face is consumer-supplied, so this file has no font asset or
3
- network side effect. */
4
-
5
- /* The layer map, stated before anything uses a layer -- see `theme.css`. The
6
- aesthetic's token class sits in `components`, below every utility, so a
7
- consumer's own utility or unlayered CSS beats it; the solo class stays
8
- unlayered, because it has to beat a foreign component's unlayered CSS. See
9
- docs/internal/model.md#cascade-layers. */
10
- @layer theme, base, components, utilities;
11
-
12
- @layer components {
13
- .sketch {
14
- /* Complete radii are taken as written, without the size step or corner
15
- pattern. Chips use a smaller version of the same irregular outline.
16
- Surfaces use sharp, hand-drawn square contours tailored for container
17
- dimensions to avoid interior padding encroachment. Knobs follow R8. */
18
- --ui-corner: initial;
19
- --ui-corner-surface: initial;
20
- --ui-corner-tl: initial;
21
- --ui-corner-tr: initial;
22
- --ui-corner-br: initial;
23
- --ui-corner-bl: initial;
24
- --ui-radius: var(--sketch-radius, 255px 15px 225px 15px / 15px 225px 15px 255px);
25
- --ui-radius-surface: var(--sketch-radius-surface, 80px 4px 75px 5px / 3px 70px 4px 80px);
26
- --ui-radius-pill: var(--sketch-radius-pill, 20px 22px 21px 19px / 20px 22px 21px 19px);
27
- --ui-radius-tight: 11px 1px 7px 2px / 2px 7px 1px 11px;
28
- --ui-corner-shape: round;
29
-
30
- --ui-ink: light-dark(var(--color-neutral-950), var(--color-neutral-50));
31
- /* Controls take the theme's control border rather than the ink, which is the
32
- primary colour in both themes; see `neobrutalism.css`. */
33
- --ui-control-ink: var(--color-control-border);
34
- --ui-rule-ink: initial;
35
- --ui-border-width: 1px;
36
- --ui-border-max: 100px;
37
- --ui-line-style: solid;
38
- --ui-rule-style: initial;
39
-
40
- --ui-shadow-ink: 0%;
41
- /* The foundation depth colour is restated so a sketch region nested inside
42
- cyber does not inherit cyber's transparent depth. */
43
- --elevation-color: light-dark(rgb(15 23 42 / 0.08), rgb(0 0 0 / 0.55));
44
- --ui-shadow-x: 2px;
45
- --ui-shadow-y: 2px;
46
- --ui-shadow-blur: 0px;
47
- --ui-shadow-spread: 0px;
48
- --ui-shadow-inset: ;
49
- --ui-shadow-edge: initial;
50
- --ui-halo-blur: initial;
51
- --ui-halo-spread: initial;
52
- --ui-halo-ink: initial;
53
- --ui-focus-inset: initial;
54
-
55
- --ui-active-shadow-x: initial;
56
- --ui-active-shadow-y: initial;
57
- --ui-active-transform: scale(0.97);
58
- --ui-active-translate-x: initial;
59
- --ui-active-translate-y: initial;
60
- --ui-hover-transform: none;
61
- --ui-clip: none;
62
- --ui-clip-tight: none;
63
- --ui-backdrop: none;
64
- --ui-surface-image: initial;
65
- --ui-surface-ground: initial;
66
- --ui-surface-shadow: initial;
67
- --ui-bg-alpha: 1;
68
- --ui-label-weight: initial;
69
- --ui-label-tracking: initial;
70
- --ui-label-case: initial;
71
- --ui-label-shadow: initial;
72
-
73
- font-family: var(--font-sketch, cursive);
74
- }
75
-
76
- @media (prefers-reduced-motion: reduce) {
77
- .sketch {
78
- --ui-active-transform: none;
79
- }
80
- }
81
-
82
- /* Rounded variant: bounded elliptical corners, so the top and bottom edges of
83
- a wide element stay straight instead of bulging into an egg. On the region
84
- with `.sketch`, or on one component inside it. Knobs follow R8. */
85
- .sketch-rounded {
86
- --ui-radius: var(--sketch-radius-rounded, 26px 10px 24px 11px / 12px 23px 11px 20px);
87
- --ui-radius-surface: var(--sketch-radius-surface-rounded, 38px 16px 36px 17px / 16px 34px 17px 32px);
88
- --ui-radius-pill: var(--sketch-radius-pill, 24px 16px 23px 17px / 17px 21px 16px 20px);
89
- --ui-radius-tight: 9px 3px 8px 4px / 4px 8px 3px 7px;
90
- }
91
-
92
- /* One region token gives every element the same outline, so the rotation and
93
- the dashed accents are written on components, which the registry records.
94
- The root is a component carrying either class, or one inside either region
95
- and not inside another aesthetic nested there, which keeps its own
96
- material. The list below is the one place other aesthetics are named, and
97
- `registry.test.ts` fails when one is missing from it.
98
-
99
- Rotation is by sibling position, and a field's control takes its field's
100
- position instead of its own, so stacked rows alternate. It is stable for a
101
- given DOM order. A knob, when set, is one outline for every position. */
102
- :is(
103
- .sketch,
104
- .sketch-rounded,
105
- :is(.sketch, .sketch-rounded)
106
- :not(
107
- :is(.sketch, .sketch-rounded) :is(.neobrutalism, .glass, .pixel, .chunky-tile, .cyber),
108
- :is(.sketch, .sketch-rounded) :is(.neobrutalism, .glass, .pixel, .chunky-tile, .cyber) *
109
- )
110
- ) {
111
- /* The pointed outlines: controls, fields, surfaces, and chips. */
112
- &:is(.sketch, .sketch *):not(.sketch-rounded, .sketch-rounded *) {
113
- &:is(.btn, .ipt, .textarea, .select, .input-group, .pre, .tooltip-bubble) {
114
- &:nth-child(4n + 2) {
115
- --ui-radius: var(--sketch-radius, 18px 240px 15px 255px / 240px 15px 255px 18px);
116
- }
117
-
118
- &:nth-child(4n + 3) {
119
- --ui-radius: var(--sketch-radius, 245px 220px 15px 18px / 18px 15px 245px 235px);
120
- }
121
-
122
- &:nth-child(4n) {
123
- --ui-radius: var(--sketch-radius, 18px 250px 225px 15px / 245px 15px 18px 235px);
124
- }
125
- }
126
-
127
- &:is(.ipt, .textarea, .select, .input-group) {
128
- .field:nth-child(4n + 1) & {
129
- --ui-radius: var(--sketch-radius, 255px 15px 225px 15px / 15px 225px 15px 255px);
130
- }
131
-
132
- .field:nth-child(4n + 2) & {
133
- --ui-radius: var(--sketch-radius, 18px 240px 15px 255px / 240px 15px 255px 18px);
134
- }
135
-
136
- .field:nth-child(4n + 3) & {
137
- --ui-radius: var(--sketch-radius, 245px 220px 15px 18px / 18px 15px 245px 235px);
138
- }
139
-
140
- .field:nth-child(4n) & {
141
- --ui-radius: var(--sketch-radius, 18px 250px 225px 15px / 245px 15px 18px 235px);
142
- }
143
- }
144
-
145
- &:is(.card, .panel, .alert, .data-table) {
146
- &:nth-child(4n + 2) {
147
- --ui-radius-surface: var(--sketch-radius-surface, 4px 75px 5px 80px / 75px 3px 80px 4px);
148
- }
149
-
150
- &:nth-child(4n + 3) {
151
- --ui-radius-surface: var(--sketch-radius-surface, 75px 70px 4px 5px / 4px 3px 75px 70px);
152
- }
153
-
154
- &:nth-child(4n) {
155
- --ui-radius-surface: var(--sketch-radius-surface, 5px 80px 75px 4px / 75px 4px 5px 70px);
156
- }
157
- }
158
-
159
- &:is(.badge, .kbd, .code, .checkbox, .switch, .progress) {
160
- &:nth-child(4n + 2) {
161
- --ui-radius-tight: 2px 8px 1px 10px / 8px 2px 10px 1px;
162
- }
163
-
164
- &:nth-child(4n + 3) {
165
- --ui-radius-tight: 8px 2px 10px 1px / 1px 9px 2px 8px;
166
- }
167
-
168
- &:nth-child(4n) {
169
- --ui-radius-tight: 1px 10px 2px 7px / 9px 1px 8px 2px;
170
- }
171
- }
172
- }
173
-
174
- /* The rounded outlines, in the same four places. */
175
- &:is(.sketch-rounded, .sketch-rounded *) {
176
- &:is(.btn, .ipt, .textarea, .select, .input-group, .pre, .tooltip-bubble) {
177
- &:nth-child(4n + 2) {
178
- --ui-radius: var(--sketch-radius-rounded, 11px 25px 12px 24px / 23px 11px 22px 12px);
179
- }
180
-
181
- &:nth-child(4n + 3) {
182
- --ui-radius: var(--sketch-radius-rounded, 24px 12px 26px 10px / 11px 23px 12px 22px);
183
- }
184
-
185
- &:nth-child(4n) {
186
- --ui-radius: var(--sketch-radius-rounded, 12px 24px 10px 25px / 22px 12px 23px 11px);
187
- }
188
- }
189
-
190
- &:is(.ipt, .textarea, .select, .input-group) {
191
- .field:nth-child(4n + 1) & {
192
- --ui-radius: var(--sketch-radius-rounded, 26px 10px 24px 11px / 12px 23px 11px 20px);
193
- }
194
-
195
- .field:nth-child(4n + 2) & {
196
- --ui-radius: var(--sketch-radius-rounded, 11px 25px 12px 24px / 23px 11px 22px 12px);
197
- }
198
-
199
- .field:nth-child(4n + 3) & {
200
- --ui-radius: var(--sketch-radius-rounded, 24px 12px 26px 10px / 11px 23px 12px 22px);
201
- }
202
-
203
- .field:nth-child(4n) & {
204
- --ui-radius: var(--sketch-radius-rounded, 12px 24px 10px 25px / 22px 12px 23px 11px);
205
- }
206
- }
207
-
208
- &:is(.card, .panel, .alert, .data-table) {
209
- &:nth-child(4n + 2) {
210
- --ui-radius-surface: var(--sketch-radius-surface-rounded, 17px 36px 18px 34px / 33px 16px 32px 17px);
211
- }
212
-
213
- &:nth-child(4n + 3) {
214
- --ui-radius-surface: var(--sketch-radius-surface-rounded, 35px 18px 38px 15px / 17px 32px 16px 34px);
215
- }
216
-
217
- &:nth-child(4n) {
218
- --ui-radius-surface: var(--sketch-radius-surface-rounded, 18px 35px 16px 37px / 31px 17px 34px 16px);
219
- }
220
- }
221
-
222
- &:is(.badge, .kbd, .code, .checkbox, .switch, .progress) {
223
- &:nth-child(4n + 2) {
224
- --ui-radius-tight: 4px 8px 3px 9px / 8px 3px 8px 4px;
225
- }
226
-
227
- &:nth-child(4n + 3) {
228
- --ui-radius-tight: 8px 4px 9px 3px / 3px 9px 4px 8px;
229
- }
230
-
231
- &:nth-child(4n) {
232
- --ui-radius-tight: 3px 9px 4px 8px / 9px 4px 8px 3px;
233
- }
234
- }
235
- }
236
-
237
- /* A pill button keeps a rounded pill in either variant, bounded to the
238
- button's half-height so a wide one keeps flat top and bottom edges. */
239
- &.btn.pill {
240
- --ui-radius-pill: var(--sketch-radius-pill, 24px 16px 23px 17px / 17px 21px 16px 20px);
241
-
242
- &:nth-child(4n + 2) {
243
- --ui-radius-pill: var(--sketch-radius-pill, 17px 23px 16px 24px / 21px 16px 20px 17px);
244
- }
245
-
246
- &:nth-child(4n + 3) {
247
- --ui-radius-pill: var(--sketch-radius-pill, 23px 17px 24px 16px / 16px 20px 17px 21px);
248
- }
249
-
250
- &:nth-child(4n) {
251
- --ui-radius-pill: var(--sketch-radius-pill, 16px 24px 17px 23px / 20px 17px 21px 16px);
252
- }
253
- }
254
-
255
- /* Badges, progress bars, and switches take their chip outline where they
256
- would be fully round. */
257
- &:is(.badge, .progress, .switch) {
258
- --ui-radius-pill: var(--ui-radius-tight);
259
- }
260
-
261
- /* Radios and the tooltip trigger stay circles, slightly uneven, so a radio
262
- is never mistaken for a checkbox. */
263
- &:is(.radio, .tooltip-icon) {
264
- --ui-radius-pill: 48% 52% 46% 54% / 53% 46% 54% 47%;
265
- }
266
-
267
- /* The dashed accents; every other line stays solid. */
268
- &:is(.sketch, .sketch *) {
269
- &.checkbox {
270
- --ui-line-style: dashed;
271
- }
272
-
273
- &:is(.divider, .data-table) {
274
- --ui-rule-style: dashed;
275
- }
276
- }
277
- }
278
- }
279
-
280
- /* Solo: the look on one unstyled element. It uses standalone fallbacks rather
281
- than material tokens inherited from an aesthetic around it. */
282
- .sketch-solo {
283
- --_sketch-ink: light-dark(var(--color-neutral-950, oklch(14.5% 0 0)), var(--color-neutral-50, oklch(98.5% 0 0)));
284
-
285
- border: 1px solid var(--_sketch-ink);
286
- /* The surface shape: the element this exists for is usually a pane. An action
287
- takes the control shape below. */
288
- border-radius: var(--sketch-radius-surface, 80px 4px 75px 5px / 3px 70px 4px 80px);
289
- /* The aesthetic's neutral depth cue, not the ink: the class casts its 2px
290
- offset in the depth colour, and casting a solo pane in full ink would read
291
- as a heavier, neobrutalist slab. The depth colour is a literal, for the reason
292
- `.glass-solo` gives. */
293
- box-shadow: 2px 2px 0 0 light-dark(rgb(15 23 42 / 0.08), rgb(0 0 0 / 0.55));
294
- font-family: var(--font-sketch, cursive);
295
- }
296
-
297
- /* An action takes the expressive control shape. */
298
- .sketch-solo:is(
299
- button,
300
- a[href],
301
- [role="button"],
302
- summary,
303
- input[type="button"],
304
- input[type="submit"],
305
- input[type="reset"]
306
- ) {
307
- border-radius: var(--sketch-radius, 255px 15px 225px 15px / 15px 225px 15px 255px);
308
- }
309
-
310
- /* With `.sketch-rounded`, the rounded outlines, through their own knobs. */
311
- .sketch-solo.sketch-rounded {
312
- border-radius: var(--sketch-radius-surface-rounded, 38px 16px 36px 17px / 16px 34px 17px 32px);
313
- }
314
-
315
- .sketch-solo.sketch-rounded:is(
316
- button,
317
- a[href],
318
- [role="button"],
319
- summary,
320
- input[type="button"],
321
- input[type="submit"],
322
- input[type="reset"]
323
- ) {
324
- border-radius: var(--sketch-radius-rounded, 26px 10px 24px 11px / 12px 23px 11px 20px);
325
- }
326
-
327
- /* This entrypoint may be the only package stylesheet loaded, so it cannot rely
328
- on theme.css's forced-colors material reset. */
329
- @media (forced-colors: active) {
330
- .sketch-solo {
331
- border-style: solid;
332
- }
333
- }
@@ -1,139 +0,0 @@
1
- @reference "tailwindcss";
2
- @import "../theme.css";
3
- @reference "../box.css";
4
-
5
- /* A filled, edgeless, raised box you can press. `box` paints it; everything
6
- here is what makes it a button rather than some other box.
7
-
8
- The resting values are the published default: a button with no presentation
9
- class is solid and edgeless, and that is a decision written on three lines
10
- rather than a `var()` fallback buried in an expression. */
11
- @utility btn {
12
- --_d-fill: 100%;
13
- --_d-fg-on-fill: 100%;
14
- --_d-border: 0%;
15
- --_d-elevation: 1;
16
-
17
- @apply box box-hover box-active relative inline-flex w-fit cursor-pointer items-center justify-center gap-2 px-4 py-2 whitespace-nowrap no-underline select-none;
18
-
19
- min-height: var(--control-height);
20
- /* The vertical padding gives back the line `box` draws, so a default button
21
- is exactly `--control-height` tall like `.ipt` beside it, under any
22
- aesthetic's line width. At the default 16px/1.5 text the label and the
23
- padding fill it; the size and padding modifiers set their own. */
24
- padding-block: calc(0.5rem - var(--_width));
25
- /* The surrounding font, not the user agent's smaller button one, on every
26
- entry: `/components` carries no reset to say so, and a `.btn` link and a
27
- `.btn` button have to print the same label. `.sm` and `.lg` set their own
28
- size over this. */
29
- font-family: inherit;
30
- font-size: inherit;
31
- line-height: inherit;
32
- /* The label is material, shared with `.badge`: weight, tracking, case, and a
33
- text shadow, set by an aesthetic as tokens (`.chunky-tile`'s heavier,
34
- tracked label), and a consumer's own `font-*`, `tracking-*`, `uppercase`, or
35
- text-shadow utility still beats the aesthetic. Tracking has no fallback on
36
- purpose: undefined, the declaration is invalid at computed-value time and
37
- `letter-spacing` inherits, which is what it did before the slot existed.
38
- Case and shadow fall back to `none`, which is what a button already does:
39
- the user agent stops both inheriting into one. The shadow is written
40
- without a colour, so it takes the label's own and cannot lower its
41
- contrast. See docs/internal/model.md#cascade-layers. */
42
- font-weight: var(--ui-label-weight, var(--font-weight-semibold));
43
- letter-spacing: var(--ui-label-tracking);
44
- text-transform: var(--ui-label-case, none);
45
- text-shadow: var(--ui-label-shadow, none);
46
-
47
- &.sm {
48
- @apply min-h-8 px-3 py-1 text-sm;
49
-
50
- --_scale-size: 0.75;
51
- }
52
-
53
- &.lg {
54
- @apply min-h-12 px-5 py-2.5 text-[1.0625rem];
55
-
56
- --_scale-size: 1.25;
57
- }
58
-
59
- &.icon {
60
- @apply aspect-square p-2;
61
-
62
- min-width: var(--control-height);
63
- }
64
-
65
- /* The size steps for an icon button, square at each: `.sm`'s 2rem, with the
66
- padding giving back the line width the way the default button's does, and
67
- `.lg`'s 3rem. Each names its width as well as its height, because WebKit
68
- does not let `aspect-ratio` widen a box past its `min-width`. */
69
- &.icon.sm {
70
- min-width: 2rem;
71
- padding: calc(0.375rem - var(--_width));
72
- }
73
-
74
- &.icon.lg {
75
- min-width: 3rem;
76
- }
77
-
78
- /* Bare `sm`/`lg` are the size modifier's class names, so `p-` prefixes here.
79
- `.p-xs` is the tightest step, below `.p-sm`: a chip-sized button in a
80
- toolbar or a table cell.
81
-
82
- `.icon` drops both floors -- `min-width` from its own base rule above and
83
- `min-height` from `--control-height` -- at every padding tier; labeled
84
- buttons keep the height floor everywhere but `.p-xs`. `.icon` is already
85
- square: `aspect-square` ties its width to whatever height it lands on, so a
86
- surviving height floor would keep the button bigger than its own glyph
87
- however tight the padding asked to be. */
88
- &.p-xs {
89
- @apply px-2 py-0.5;
90
-
91
- --_scale-pad: 0.5;
92
-
93
- /* The one padding step that also drops the size floor for a labeled
94
- button. At this tier the button is a chip in a toolbar or a table
95
- cell, where `--control-height` is taller than the row it sits in;
96
- every other size and padding class keeps the floor, so a plain button
97
- stays a comfortable target. */
98
- min-height: 0;
99
-
100
- &.icon {
101
- @apply p-0.5;
102
-
103
- min-width: 0;
104
- }
105
- }
106
-
107
- &.p-sm {
108
- @apply px-2.5 py-1;
109
-
110
- --_scale-pad: 0.75;
111
-
112
- &.icon {
113
- @apply p-1;
114
-
115
- min-width: 0;
116
- min-height: 0;
117
- }
118
- }
119
-
120
- &.p-lg {
121
- @apply px-6 py-3;
122
-
123
- --_scale-pad: 1.25;
124
-
125
- &.icon {
126
- @apply p-3;
127
-
128
- min-width: 0;
129
- min-height: 0;
130
- }
131
- }
132
-
133
- /* A pill normally takes the round material ahead of the box radius. Sketch
134
- gives this token the button's own box outline; a bevel still cuts the full
135
- radius to points under cyber. */
136
- &.pill {
137
- border-radius: var(--ui-radius-pill, calc(infinity * 1px));
138
- }
139
- }
@@ -1,36 +0,0 @@
1
- /* The layer map, stated before any import uses a layer -- see `theme.css`.
2
- Tailwind's utilities are imported into `utilities` the way
3
- `tailwindcss/index.css` does it, so every component lands there on this
4
- entrypoint and on `/native` too, exactly where `.` already puts them. Without
5
- `layer(utilities)` the CLI emitted them unlayered here, and they beat every
6
- consumer rule on these two entries alone. */
7
- @layer theme, base, components, utilities;
8
-
9
- /* The theme before `@reference "tailwindcss"`, as `native.css` has it:
10
- Tailwind writes the theme's variables at the first `@theme` it meets, and
11
- after the reference that is Tailwind's own reference-only one. See
12
- docs/internal/model.md (Which files import the theme). */
13
- @import "../theme.css";
14
- @reference "tailwindcss";
15
- @import "tailwindcss/utilities.css" layer(utilities);
16
- /* Everything that is not `src/` -- see the note in `index.css`. Keeps a class
17
- name in a docs code fence from shipping as a real rule in `dist/components.css`. */
18
- @import "../typography.css";
19
- @import "../box.css";
20
- @import "./button.css";
21
- @import "./feedback.css";
22
- @import "./form.css";
23
- @import "./loader.css";
24
- @import "./surface.css";
25
- @import "./tooltip.css";
26
-
27
- /* The composition utilities -- `box`, `box-hover`, `box-active`, `loader-mask`,
28
- `text-control`, `surface`, `input-group` -- are `@utility` rules whose bodies
29
- the content scan will not emit on its own. `box` and friends appear only as
30
- `@utility` blocks and `@apply` targets; `text-control`, `surface` and
31
- `input-group` appear only inside `:is()`/`:where()` argument lists in
32
- `intent.css` and `form.css`, never as a selector of their own. Safelisting
33
- all seven makes the emission deliberate; the composition-body check in
34
- `exports.test.ts` fails the build if one is dropped. `text-control` and
35
- `surface` are also documented as consumer-usable on their own. */
36
- @source inline("box box-hover box-active loader-mask text-control surface input-group unadorned text-display text-title-lg text-title text-title-sm text-label-lg text-label text-body btn field label hint ipt email password url tel search date datetime month week time icon left right textarea select checkbox radio switch alert alert-icon badge skeleton progress tooltip tooltip-bubble tooltip-icon card panel interactive flush neutral solid soft ghost edged edgeless flat raised floating loader");
@@ -1,116 +0,0 @@
1
- @source inline("loader dots-wave dots-fade dots-queue dots-rotate dots-grow dots-grow-alternate dot-bounce bars-wave pulse-ring");
2
-
3
- /* The mask machinery, shared by the loader and by any component that shows a
4
- spinner of its own. Artwork is a mask rather than an image so it takes its
5
- colour from whatever paints behind it, which is the whole indicator contract:
6
- an intent class recolours the loader and nothing else has to know.
7
-
8
- Each artwork's closing `style` tag is percent-encoded. A stylesheet pasted
9
- into an HTML `<style>` element ends at the first literal close tag, so one
10
- left raw would silently drop every rule after it; the data URI decodes the
11
- escape before the SVG is parsed, so the artwork is unchanged. The exports
12
- test fails a build that ships the raw sequence. */
13
- @utility loader-mask {
14
- mask-image: var(--loader-art);
15
- -webkit-mask-image: var(--loader-art);
16
- mask-size: contain;
17
- -webkit-mask-size: contain;
18
- mask-repeat: no-repeat;
19
- -webkit-mask-repeat: no-repeat;
20
- mask-position: center;
21
- -webkit-mask-position: center;
22
- }
23
-
24
- /* In `utilities`, beside the loader and art utilities it defaults for -- see
25
- the seams note in `form.css`. */
26
- @layer utilities {
27
- .loader:not(
28
- :where(
29
- .dots-wave,
30
- .dots-fade,
31
- .dots-queue,
32
- .dots-rotate,
33
- .dots-grow,
34
- .dots-grow-alternate,
35
- .dot-bounce,
36
- .bars-wave,
37
- .pulse-ring
38
- )
39
- ) {
40
- --loader-art: url("data:image/svg+xml;charset=utf-8,<svg stroke='currentColor' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'><style>.spinner_V8m1{transform-origin:center;animation:spinner_zKoa 2s linear infinite}.spinner_V8m1 circle{stroke-linecap:round;animation:spinner_YpZS 1.5s ease-in-out infinite}@keyframes spinner_zKoa{100%{transform:rotate(360deg)}}@keyframes spinner_YpZS{0%{stroke-dasharray:0 150;stroke-dashoffset:0}47.5%{stroke-dasharray:42 150;stroke-dashoffset:-16}95%,100%{stroke-dasharray:42 150;stroke-dashoffset:-59}}%3C/style%3E<g class='spinner_V8m1'><circle cx='12' cy='12' r='9.5' fill='none' stroke-width='3'></circle></g></svg>");
41
- }
42
- }
43
-
44
- @utility dots-wave {
45
- --loader-art: url("data:image/svg+xml;charset=utf-8,<svg fill='currentColor' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'><style>@keyframes spinner_8HQG{0%,57.14%{animation-timing-function:cubic-bezier(.33,.66,.66,1);transform:translate(0)}28.57%{animation-timing-function:cubic-bezier(.33,0,.66,.33);transform:translateY(-6px)}to{transform:translate(0)}}.spinner_qM83{animation:spinner_8HQG 1.05s infinite}%3C/style%3E<circle class='spinner_qM83' cx='4' cy='12' r='3'/><circle class='spinner_qM83' cx='12' cy='12' r='3' style='animation-delay:.1s'/><circle class='spinner_qM83' cx='20' cy='12' r='3' style='animation-delay:.2s'/></svg>");
46
- }
47
-
48
- @utility dots-fade {
49
- --loader-art: url("data:image/svg+xml;charset=utf-8,<svg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'><style>.dot{animation:dot-anim 1s ease-in-out infinite;fill:currentColor}.d1{animation-delay:-0.32s}.d2{animation-delay:-0.16s}@keyframes dot-anim{0%,80%,100%{transform:scale(0.6);opacity:0.2}40%{transform:scale(1);opacity:1}}%3C/style%3E<circle class='dot d1' cx='4' cy='12' r='3' transform-origin='4px 12px'></circle><circle class='dot d2' cx='12' cy='12' r='3' transform-origin='12px 12px'></circle><circle class='dot d3' cx='20' cy='12' r='3' transform-origin='20px 12px'></circle></svg>");
50
- }
51
-
52
- @utility dots-queue {
53
- --loader-art: url("data:image/svg+xml;charset=utf-8,<svg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'><style>@keyframes spinner_qtyZ{0%{r:0}25%{r:3px;cx:4px}50%{r:3px;cx:12px}75%{r:3px;cx:20px}to{r:0;cx:20px}}.spinner_nOfF{animation:spinner_qtyZ 2s cubic-bezier(.36,.6,.31,1) infinite}%3C/style%3E<circle class='spinner_nOfF' cx='4' cy='12' r='3'/><circle class='spinner_nOfF' cx='4' cy='12' r='3' style='animation-delay:-.5s'/><circle class='spinner_nOfF' cx='4' cy='12' r='3' style='animation-delay:-1s'/><circle class='spinner_nOfF' cx='4' cy='12' r='3' style='animation-delay:-1.5s'/></svg>");
54
- }
55
-
56
- @utility dots-rotate {
57
- --loader-art: url("data:image/svg+xml;charset=utf-8,<svg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'><style>@keyframes spinner_XVY9{50%{transform:rotate(180deg)}to{transform:rotate(360deg)}}%3C/style%3E<circle cx='12' cy='12' r='3'/><g style='transform-origin:center;animation:spinner_XVY9 1s cubic-bezier(.36,.6,.31,1) infinite'><circle cx='4' cy='12' r='3'/><circle cx='20' cy='12' r='3'/></g></svg>");
58
- }
59
-
60
- @utility dots-grow {
61
- --loader-art: url("data:image/svg+xml;charset=utf-8,<svg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'><style>@keyframes spinner_xe7Q{93.75%,to{r:3px}46.875%{r:.2px}}.spinner_b2T7{animation:spinner_xe7Q .8s linear infinite}%3C/style%3E<circle class='spinner_b2T7' cx='4' cy='12' r='3'/><circle class='spinner_b2T7' cx='12' cy='12' r='3' style='animation-delay:-.65s'/><circle class='spinner_b2T7' cx='20' cy='12' r='3' style='animation-delay:-.5s'/></svg>");
62
- }
63
-
64
- @utility dots-grow-alternate {
65
- --loader-art: url("data:image/svg+xml;charset=utf-8,<svg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'><style>@keyframes spinner_qhi1{0%,to{r:1.5px}50%{r:3px}}.spinner_I8Q1{animation:spinner_qhi1 .75s linear infinite}%3C/style%3E<circle class='spinner_I8Q1' cx='4' cy='12' r='1.5'/><circle class='spinner_I8Q1' cx='12' cy='12' r='3' style='animation-delay:-.375s'/><circle class='spinner_I8Q1' cx='20' cy='12' r='1.5'/></svg>");
66
- }
67
-
68
- @utility dot-bounce {
69
- --loader-art: url("data:image/svg+xml;charset=utf-8,<svg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'><style>@keyframes spinner_YeBj{0%{animation-timing-function:cubic-bezier(.33,0,.66,.33);cy:5px}46.875%{cy:20px;rx:4px;ry:4px}50%{animation-timing-function:cubic-bezier(.33,.66,.66,1);cy:20.5px;rx:4.8px;ry:3px}53.125%{rx:4px;ry:4px}to{cy:5px}}%3C/style%3E<circle cx='12' cy='5' style='animation:spinner_YeBj .8s infinite' r='4'/></svg>");
70
- }
71
-
72
- @utility bars-wave {
73
- --loader-art: url("data:image/svg+xml;charset=utf-8,<svg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'><style>.bar{animation:bar-anim 1s ease-in-out infinite;fill:currentColor}.b1{animation-delay:-0.4s}.b2{animation-delay:-0.2s}@keyframes bar-anim{0%,100%{transform:scaleY(0.3)}50%{transform:scaleY(1)}}%3C/style%3E<rect class='bar b1' x='3' y='2' width='4' height='20' rx='2' transform-origin='5px 12px'></rect><rect class='bar b2' x='10' y='2' width='4' height='20' rx='2' transform-origin='12px 12px'></rect><rect class='bar b3' x='17' y='2' width='4' height='20' rx='2' transform-origin='19px 12px'></rect></svg>");
74
- }
75
-
76
- @utility pulse-ring {
77
- --loader-art: url("data:image/svg+xml;charset=utf-8,<svg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'><style>.pulse{animation:pulse-anim 1.2s cubic-bezier(0, 0.2, 0.8, 1) infinite;stroke:currentColor;transform-origin:center}.p2{animation-delay:-0.6s}@keyframes pulse-anim{0%{transform:scale(0);opacity:1}100%{transform:scale(1);opacity:0}}%3C/style%3E<circle class='pulse p1' cx='12' cy='12' r='10' fill='none' stroke-width='3'></circle><circle class='pulse p2' cx='12' cy='12' r='10' fill='none' stroke-width='3'></circle></svg>");
78
- }
79
-
80
- /* A loader takes a colour and its own geometry, and nothing else: no fill, no
81
- edge, no silhouette. `--intent-color` defaults to `currentColor` for
82
- indicators, so a loader inside filled content matches the text around it and
83
- `.loader.success` is green. */
84
- @utility loader {
85
- @apply loader-mask inline-block size-7 [&.lg]:size-9 [&.sm]:size-5;
86
-
87
- color: var(--intent-color);
88
- background-color: currentColor;
89
- }
90
-
91
- @media (prefers-reduced-motion: reduce) {
92
- .loader {
93
- --loader-art: url("data:image/svg+xml;charset=utf-8,<svg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'><circle cx='12' cy='12' r='9.5' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-dasharray='42 18'/></svg>");
94
- }
95
-
96
- .dots-wave,
97
- .dots-fade,
98
- .dots-queue,
99
- .dots-rotate,
100
- .dots-grow,
101
- .dots-grow-alternate {
102
- --loader-art: url("data:image/svg+xml;charset=utf-8,<svg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'><circle cx='4' cy='12' r='3'/><circle cx='12' cy='12' r='3'/><circle cx='20' cy='12' r='3'/></svg>");
103
- }
104
-
105
- .dot-bounce {
106
- --loader-art: url("data:image/svg+xml;charset=utf-8,<svg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'><circle cx='12' cy='12' r='4'/></svg>");
107
- }
108
-
109
- .bars-wave {
110
- --loader-art: url("data:image/svg+xml;charset=utf-8,<svg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'><rect x='3' y='5' width='4' height='14' rx='2'/><rect x='10' y='5' width='4' height='14' rx='2'/><rect x='17' y='5' width='4' height='14' rx='2'/></svg>");
111
- }
112
-
113
- .pulse-ring {
114
- --loader-art: url("data:image/svg+xml;charset=utf-8,<svg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'><circle cx='12' cy='12' r='9' fill='none' stroke='black' stroke-width='3'/></svg>");
115
- }
116
- }