@codenhub/styles 0.0.3 → 0.1.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 (75) hide show
  1. package/LICENSE +201 -0
  2. package/NOTICE +52 -0
  3. package/README.md +60 -90
  4. package/dist/aesthetics/chunky-tile.css +1 -0
  5. package/dist/aesthetics/glass.css +1 -0
  6. package/dist/aesthetics/index.css +2 -0
  7. package/dist/aesthetics/neobrutalism.css +1 -0
  8. package/dist/aesthetics/pixel.css +1 -0
  9. package/dist/components.css +2 -2
  10. package/dist/index.css +2 -2
  11. package/dist/native.css +2 -0
  12. package/dist/theme.css +2 -2
  13. package/dist/tw/aesthetics/chunky-tile.css +107 -0
  14. package/dist/tw/aesthetics/glass.css +66 -0
  15. package/dist/tw/aesthetics/index.css +9 -0
  16. package/dist/tw/aesthetics/neobrutalism.css +63 -0
  17. package/dist/tw/aesthetics/pixel.css +88 -0
  18. package/dist/tw/box.css +185 -0
  19. package/dist/tw/components/button.css +88 -0
  20. package/dist/tw/components/feedback.css +163 -0
  21. package/dist/tw/components/form.css +601 -0
  22. package/dist/tw/components/index.css +18 -0
  23. package/dist/tw/components/loader.css +122 -0
  24. package/dist/tw/components/surface.css +98 -0
  25. package/dist/tw/components/tooltip.css +132 -0
  26. package/dist/tw/elevation.css +39 -0
  27. package/dist/tw/index.css +12 -0
  28. package/dist/tw/intent.css +189 -0
  29. package/dist/tw/native.css +203 -0
  30. package/dist/tw/presentation.css +77 -0
  31. package/dist/tw/reset.css +142 -0
  32. package/dist/tw/theme.css +218 -0
  33. package/dist/tw/typography.css +34 -0
  34. package/dist/tw/utilities/content.css +349 -0
  35. package/dist/tw/utilities/index.css +6 -0
  36. package/dist/tw/utilities/layout.css +107 -0
  37. package/docs/accessibility.md +43 -14
  38. package/docs/concepts.md +94 -0
  39. package/docs/index.md +62 -73
  40. package/docs/integrating/astro.md +29 -0
  41. package/docs/integrating/index.md +32 -0
  42. package/docs/integrating/nextjs.md +44 -0
  43. package/docs/integrating/svelte.md +37 -0
  44. package/docs/integrating/tailwind.md +40 -0
  45. package/docs/integrating/vue.md +25 -0
  46. package/docs/setup.md +116 -0
  47. package/docs/usage/aesthetics.md +197 -0
  48. package/docs/usage/buttons.md +74 -0
  49. package/docs/usage/composing.md +218 -0
  50. package/docs/usage/content-and-layout.md +200 -0
  51. package/docs/usage/customizing.md +213 -0
  52. package/docs/usage/feedback.md +117 -0
  53. package/docs/usage/forms.md +177 -0
  54. package/docs/usage/index.md +32 -0
  55. package/docs/usage/theming.md +210 -0
  56. package/docs/usage/tooltips.md +45 -0
  57. package/llms-full.txt +2122 -0
  58. package/llms.txt +26 -0
  59. package/package.json +96 -32
  60. package/docs/classes.md +0 -198
  61. package/docs/roadmap.md +0 -34
  62. package/docs/tests.md +0 -128
  63. package/docs/tokens.md +0 -101
  64. package/src/components/button.css +0 -155
  65. package/src/components/feedback.css +0 -214
  66. package/src/components/form.css +0 -296
  67. package/src/components/index.css +0 -9
  68. package/src/components/loader.css +0 -56
  69. package/src/components/surface.css +0 -6
  70. package/src/components/tooltip.css +0 -60
  71. package/src/index.css +0 -7
  72. package/src/overrides.css +0 -76
  73. package/src/theme.css +0 -136
  74. package/src/typography.css +0 -30
  75. package/src/utilities.css +0 -40
@@ -0,0 +1,177 @@
1
+ ---
2
+ title: Forms
3
+ description: Field, text control, and toggle class reference.
4
+ ---
5
+
6
+ # Forms
7
+
8
+ | Class or Selector | Purpose |
9
+ | --------------------------------------------------------------------- | ------------------------------------------------------------- |
10
+ | `.field` | Vertical field wrapper. |
11
+ | `.label` | Form label text. |
12
+ | `.hint` | Secondary helper text. |
13
+ | `.hint.error` | Helper text with destructive intent. |
14
+ | `.surface` | Shared public container composition utility. |
15
+ | `.text-control` | Shared public text-control composition utility. |
16
+ | `.ipt` | Input control styling. |
17
+ | `.input-group` | Wrapper that owns the field box so a control can carry icons. |
18
+ | `.textarea` | Textarea control styling. |
19
+ | `.select` | Select control styling. |
20
+ | `input[type="checkbox"].checkbox` | Custom checkbox control styling. |
21
+ | `input[type="radio"].radio` | Custom radio control styling. |
22
+ | `input[type="checkbox"].switch` | Custom switch control styling. |
23
+ | `[aria-invalid="true"]` on controls | Destructive border and focus color. |
24
+ | `[disabled]`, `[aria-disabled="true"]`, `[data-disabled]` on controls | Disabled styling. |
25
+
26
+ ## Icons
27
+
28
+ The package ships no icons. It used to paint one per input type as a
29
+ `background-image` — a `data:` URI, which cannot read `currentColor` or a
30
+ custom property, so every glyph shipped a light and a dark copy and a theme
31
+ selector chose between them. That put icon artwork, and the package's only
32
+ theme-by-selector branch, inside a CSS-only design system whose glyphs did
33
+ not fit every aesthetic. Icons are the consumer's to choose now.
34
+
35
+ `.input-group` is the wrapper for a control that carries one. It owns the
36
+ field box — border, radius, fill, focus ring, invalid and disabled state —
37
+ and the control inside it goes flush, so the boundary is drawn once. Any
38
+ icon element works, placed before the control for a leading icon or after it
39
+ for a trailing one: an inline `<svg>`, an `<img>`, or a class from an icon
40
+ set such as `@codenhub/icons`.
41
+
42
+ ```html
43
+ <label class="field">
44
+ <span class="label">Email</span>
45
+ <div class="input-group">
46
+ <svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" aria-hidden="true">
47
+ <rect width="20" height="16" x="2" y="4" rx="2" />
48
+ <path d="m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7" />
49
+ </svg>
50
+ <input class="ipt" type="email" />
51
+ </div>
52
+ </label>
53
+ <label class="field">
54
+ <span class="label">Search</span>
55
+ <div class="input-group">
56
+ <input class="ipt" type="search" />
57
+ <i class="ic-search" aria-hidden="true"></i>
58
+ </div>
59
+ </label>
60
+ ```
61
+
62
+ The group reads intent and both [presentation](./composing.md#presentation)
63
+ axes the same way a lone `.ipt` does — `.input-group.soft.edgeless` is the
64
+ sunk variant, `.input-group.primary` colors the boundary — and follows
65
+ whichever [aesthetic](./aesthetics.md) is in scope. `aria-invalid` or
66
+ `disabled` on the control inside propagates to the group; so does either on
67
+ the group itself. Focus is shown with `:focus-within`, so unlike a lone
68
+ field the ring also appears on a mouse click.
69
+
70
+ Non-icon input types keep the browser's native `date` and `datetime-local`
71
+ pickers. WebKit's native `search` decorations are still suppressed on
72
+ `.text-control` to keep them from overlapping the value.
73
+
74
+ ## Toggles
75
+
76
+ `.checkbox`, `.radio`, and `.switch` accept the same intent classes as
77
+ buttons to set the checked color:
78
+
79
+ | Class | Meaning |
80
+ | ----------------------------------- | ----------------------- |
81
+ | `.neutral` _(default)_ | Text color, capped. |
82
+ | `.primary` | Primary color. |
83
+ | `.secondary` | Secondary/accent color. |
84
+ | `.success` | Success color. |
85
+ | `.warning` | Warning color. |
86
+ | `.destructive`, `.danger`, `.error` | Destructive color. |
87
+ | `.info` | Info color. |
88
+
89
+ All three toggles rest at `.solid`, and **`.ghost` is not supported on any of
90
+ them.** An unchecked ghost toggle is the silhouette every toggle already
91
+ has, and a checked one is a mark on nothing — a tick floating on the page, a
92
+ dot with no ring around it. A container that cascades `.ghost` onto a
93
+ toggle is floored rather than obeyed.
94
+
95
+ Presentation decides the fill in both states. Being checked lifts the cap
96
+ rather than pinning a fill, so the class still chooses:
97
+
98
+ | Toggle | unchecked | checked |
99
+ | ----------------- | --------------- | ------------------------------- |
100
+ | `.solid`, default | 20%, switch 40% | 100%, mark in the contrast tone |
101
+ | `.soft` | 12% | 12%, mark in the strong tone |
102
+
103
+ A checked checkbox and a checked switch cut their mark out of that plate. A
104
+ checked radio thickens its ring to twice the resting line and takes the
105
+ intent whole on it, so `.radio.soft` is the classic ring-and-dot radio and
106
+ `.radio.solid` is a filled circle whose dot stays readable — the mark
107
+ follows the plate rather than being pinned to the intent color.
108
+
109
+ ## Text controls
110
+
111
+ Text controls also take intent, which colors the resting border and the
112
+ focus-visible border, and both [presentation](./composing.md#presentation)
113
+ axes. `.ghost` fills nothing, `.soft` takes `12%`, and `.solid` takes `20%`
114
+ — quiet enough that typed text still reads on it, and ordered so the louder
115
+ name draws the stronger tint. None of them touches the line.
116
+
117
+ The boundary is the edge axis's, and it splits the same way. A container's
118
+ `.edgeless` is floored, so a toolbar cannot leave a field with no mark of
119
+ where typing goes. `.edgeless` on the control itself is honoured, which is
120
+ how the borderless field is spelled — it does not meet WCAG 1.4.11 at rest,
121
+ so it is opt-in and never a default, and the focus ring still shows.
122
+
123
+ ```html
124
+ <input class="ipt success" placeholder="Valid" />
125
+ <input class="ipt ghost edged" placeholder="Outlined" />
126
+ <input class="ipt soft edged" placeholder="Tinted with a border" />
127
+ <input class="ipt soft edgeless" placeholder="Sunk into the page" />
128
+ <div class="soft">
129
+ <input class="ipt" placeholder="Tinted from the container, capped at 6%" />
130
+ </div>
131
+ <div class="edgeless">
132
+ <input class="ipt" placeholder="Keeps its line; the floor holds" />
133
+ </div>
134
+ ```
135
+
136
+ `.surface` is a public low-level utility. It is the box every container in
137
+ the package composes: ghost, edged, surface radius, and the two slots only
138
+ a surface resolves — the backdrop filter and the complete surface shadow.
139
+ Use it to paint a container the package does not ship, under whichever
140
+ aesthetic is in scope. Prefer `.card` or `.panel` when they fit.
141
+
142
+ ```html
143
+ <div class="surface glass">Blurred, translucent, glass corners</div>
144
+ <div class="surface pixel">Cut corners and an inset ring</div>
145
+ <div class="surface primary solid">Any intent, any presentation</div>
146
+ ```
147
+
148
+ `.text-control` is a public low-level utility from the form entrypoint. It
149
+ provides the shared control dimensions, border, placeholder, focus-visible,
150
+ invalid, and disabled styles composed by `ipt`, `textarea`, and `select`.
151
+ Use it for custom text-like controls; prefer those higher-level utilities
152
+ when they fit.
153
+
154
+ ## Example
155
+
156
+ ```html
157
+ <label class="field">
158
+ <span class="label">Email</span>
159
+ <input class="ipt" type="email" aria-invalid="true" aria-describedby="email-error" />
160
+ <span class="hint error" id="email-error">Enter a valid email.</span>
161
+ </label>
162
+ <label style="display: flex; gap: 0.5rem; align-items: center">
163
+ <input type="checkbox" class="checkbox success" />
164
+ <span>Accept terms</span>
165
+ </label>
166
+ <label style="display: flex; gap: 0.5rem; align-items: center">
167
+ <input type="radio" class="radio secondary" name="plan" />
168
+ <span>Standard plan</span>
169
+ </label>
170
+ <label style="display: flex; gap: 0.5rem; align-items: center">
171
+ <input type="checkbox" class="switch destructive" />
172
+ <span>Enable</span>
173
+ </label>
174
+ ```
175
+
176
+ Use labels, `type`, validation logic, `aria-describedby`, and error message
177
+ relationships; see [Accessibility](../accessibility.md).
@@ -0,0 +1,32 @@
1
+ ---
2
+ title: Usage
3
+ description: Guides for composing axes, theming, customizing, aesthetics, and each component family.
4
+ ---
5
+
6
+ # Usage
7
+
8
+ These guides assume the [Concepts](../concepts.md) mental model: intent,
9
+ presentation, and aesthetic as three independent axes, resolved through
10
+ tokens a component reads.
11
+
12
+ - [Composing](./composing.md): Combining the three axes on a component, the
13
+ axis-support matrix, and elevation modifiers.
14
+ - [Theming](./theming.md): The color, intent, and foundation token reference.
15
+ - [Customizing](./customizing.md): The presentation and material token
16
+ reference, aesthetic knobs, and defining a custom intent.
17
+ - [Aesthetics](./aesthetics.md): Each shipped aesthetic in depth, including
18
+ its documented exceptions.
19
+ - [Buttons](./buttons.md)
20
+ - [Forms](./forms.md)
21
+ - [Feedback](./feedback.md)
22
+ - [Tooltips](./tooltips.md)
23
+ - [Content and layout](./content-and-layout.md): Layout helpers, tables,
24
+ quotes, code, surfaces, and typography utilities.
25
+
26
+ ## Supported surface
27
+
28
+ A class, component, and axis combination is supported when this documentation
29
+ describes it and the package playground demonstrates it. Undocumented and
30
+ undemonstrated combinations may still produce CSS, but are not maintained
31
+ behavior. Playground variant matrices are the exhaustive demonstrations; small
32
+ examples elsewhere illustrate usage without widening that contract.
@@ -0,0 +1,210 @@
1
+ ---
2
+ title: Theming
3
+ description: The color, intent, and foundation token reference.
4
+ ---
5
+
6
+ # Theming
7
+
8
+ Color tokens are how you restyle the palette; see
9
+ [Concepts → Theme selection](../concepts.md#theme-selection) for how a theme
10
+ is chosen. Intent tokens are how a component reads that palette once an
11
+ intent class is applied. Foundation tokens are the shared layout, shape, and
12
+ motion defaults underneath everything.
13
+
14
+ ## Color tokens
15
+
16
+ Each color token holds both of its theme values at once through
17
+ `light-dark()`, and the element's `color-scheme` picks one.
18
+
19
+ ```html
20
+ <section data-theme="dark">
21
+ <article>Dark token subtree</article>
22
+ </section>
23
+ ```
24
+
25
+ | Token | Purpose |
26
+ | ------------------------------ | ----------------------------------------------------------------------------------------------------------------- |
27
+ | `--color-primary` | Primary action/content color. |
28
+ | `--color-primary-contrast` | Text/icon color on primary filled surface. |
29
+ | `--color-primary-hover` | Primary hover state. |
30
+ | `--color-primary-subtle` | Low-emphasis companion tone for primary. Use as soft surface or subtle background. |
31
+ | `--color-primary-strong` | High-emphasis companion tone for primary. Use as readable text, icon, or border on subtle surfaces. |
32
+ | `--color-accent` | Secondary/accent surface. |
33
+ | `--color-accent-contrast` | Text/icon color on accent filled surface. |
34
+ | `--color-accent-hover` | Accent hover state. |
35
+ | `--color-accent-subtle` | Low-emphasis companion tone for accent. Use as soft surface or subtle background. |
36
+ | `--color-accent-strong` | High-emphasis companion tone for accent. Use as readable text, icon, or border on subtle surfaces. |
37
+ | `--color-border` | Default border color. |
38
+ | `--color-border-hover` | Interactive border color. |
39
+ | `--color-control-border` | Resting line on the six text controls; one value, drawn at a fraction on text inputs. |
40
+ | `--color-background` | Page and default raised surface background. |
41
+ | `--color-foreground` | Subtle raised foreground surface. |
42
+ | `--color-surface` | Nested or muted surface. |
43
+ | `--color-text` | Primary text color. |
44
+ | `--color-text-secondary` | Secondary text color. |
45
+ | `--color-text-contrast` | Readable color on top of a full fill of `--color-text`. A checked toggle prints it. |
46
+ | `--color-text-hover` | Text hover state. |
47
+ | `--color-text-subtle` | Low-emphasis companion tone for text. Use as soft surface or subtle background. |
48
+ | `--color-text-strong` | High-emphasis companion tone for text. Use as readable text, icon, or border on subtle surfaces. |
49
+ | `--color-tooltip` | Tooltip bubble plate with no intent. Chosen per theme rather than derived: near-white in light, mid grey in dark. |
50
+ | `--color-tooltip-contrast` | Ink on `--color-tooltip`. |
51
+ | `--color-success` | Success state color. |
52
+ | `--color-success-contrast` | Text/icon color on success filled surface. Meets 4.5:1 as normal text on `--color-success` (5.14:1). |
53
+ | `--color-success-hover` | Success hover tone. |
54
+ | `--color-success-subtle` | Low-emphasis companion tone for success. |
55
+ | `--color-success-strong` | High-emphasis companion tone for success. |
56
+ | `--color-warning` | Warning state color. |
57
+ | `--color-warning-contrast` | The near-black tone, not the page tone. Meets 4.5:1 as normal text on `--color-warning` (6.19:1). |
58
+ | `--color-warning-hover` | Warning hover tone. |
59
+ | `--color-warning-subtle` | Low-emphasis companion tone for warning. |
60
+ | `--color-warning-strong` | High-emphasis companion tone for warning. |
61
+ | `--color-destructive` | Destructive/error state color. |
62
+ | `--color-destructive-contrast` | Text/icon color on destructive filled surface. Meets 4.5:1 as normal text on `--color-destructive` (5.78:1). |
63
+ | `--color-destructive-hover` | Destructive hover tone. |
64
+ | `--color-destructive-subtle` | Low-emphasis companion tone for destructive. |
65
+ | `--color-destructive-strong` | High-emphasis companion tone for destructive. |
66
+ | `--color-info` | Informational state color. |
67
+ | `--color-info-contrast` | Text/icon color on info filled surface. Meets 4.5:1 as normal text on `--color-info` (6.19:1). |
68
+ | `--color-info-hover` | Info hover tone. |
69
+ | `--color-info-subtle` | Low-emphasis companion tone for info. |
70
+ | `--color-info-strong` | High-emphasis companion tone for info. |
71
+
72
+ > **Intent token contract**: color intent tokens own meaning and tone
73
+ > variants. Intent classes map one family onto the shared intent slots below,
74
+ > and presentation classes decide how much of it a component shows. Theme
75
+ > changes belong in token values, not broad component-level theme checks.
76
+ > Component-level theme handling should exist only when a component has an
77
+ > internal structure that cannot be expressed through the token palette
78
+ > alone.
79
+
80
+ ## Intent tokens
81
+
82
+ Intent classes set these seven slots; components read them. Because every
83
+ supporting component reads the same seven names, an intent works on every
84
+ component that supports intent, and a custom intent needs no component
85
+ changes.
86
+
87
+ | Token | Purpose |
88
+ | ------------------- | ------------------------------------------------------------------------------------- |
89
+ | `--intent-color` | The intent's base color. What a fill is made of. |
90
+ | `--intent-contrast` | Readable color on top of a filled `--intent-color`. |
91
+ | `--intent-hover` | The intent's hovered base color. |
92
+ | `--intent-strong` | The intent printed on a page. Text, icon, or border wherever the fill is not full. |
93
+ | `--intent-subtle` | Low-emphasis tone. Tinted surfaces and tracks. Neutral resolves to `--color-surface`. |
94
+ | `--intent-border` | Line color. Resolves to `--color-border` when no intent is set. |
95
+ | `--intent-fill-max` | How far a fill of this intent is allowed to go. `100%` for every intent but neutral. |
96
+
97
+ `--intent-color` and `--intent-strong` are two ends of the same family and not
98
+ interchangeable. The base is a ground, chosen to be filled with; the strong
99
+ tone is chosen to be read against a page. A `.soft` or `.ghost` component
100
+ prints the strong one, which is why an unfilled warning reads in amber-800
101
+ rather than the amber-600 its solid sibling is filled with.
102
+
103
+ The strong tone has to stay recognisably its own hue, not just readable. On a
104
+ dark page the `-100` shade of every family is a pale tint that carries almost
105
+ no chroma at small sizes: a soft success badge and a soft destructive one
106
+ printed labels that both read white, and a soft radio's dot stopped matching
107
+ the ring around it. The dark tones are `-300` for that reason, and the tinted
108
+ grounds under them are `-900` so there is room — measured at 5.0:1 or better
109
+ everywhere a partial fill prints text, and past 9:1 on the page.
110
+
111
+ `--intent-border` exists because a neutral border must stay the quiet border
112
+ gray rather than the text color. Everything that draws a line reads it:
113
+ control borders, table rules, dividers, key caps, and quote bars.
114
+
115
+ `--intent-fill-max` exists for the neutral intent, whose color is the page's
116
+ own ink. Every other intent is a hue, legible pale at 12% and saturated at
117
+ 100%; a grey filled to 100% is a black or white slab, which is the loudest
118
+ thing on the page and the wrong look for the intent that means _nothing in
119
+ particular_. Neutral stops at `20%`, so `.solid` gives it a quiet plate that
120
+ still reads as a step past `.soft`. Hover adds its step on top of the cap, so
121
+ a capped fill still deepens under the pointer.
122
+
123
+ The foreground is gated by the plate rather than tied to the fill.
124
+ `--intent-contrast` is the ink for a _full_ fill, so printing it at full
125
+ strength on a fifth of one puts white on light grey. Contrast ink therefore
126
+ appears only once the fill is past halfway and reaches full at a full fill;
127
+ below that a component prints `--intent-strong`, the tone chosen to be read.
128
+
129
+ That means a capped neutral takes the strong tone whole rather than a
130
+ fraction of the way toward the page. Tying it to the fill instead cost a
131
+ neutral `.solid` button four points of contrast and a neutral tooltip nearly
132
+ ten. A state that lifts the cap on purpose — a checked checkbox is filled
133
+ with its own intent by definition — reaches a full fill and gets the contrast
134
+ whole.
135
+
136
+ Set them directly to define an intent this package does not ship. **State
137
+ every slot**, including `--intent-fill-max`: components reset all seven to
138
+ the neutral values, so a slot your intent leaves out keeps neutral's — and an
139
+ intent that omits the cap fills to 20% of its color instead of 100%.
140
+
141
+ ```css
142
+ .brand {
143
+ --intent-color: var(--color-violet-600);
144
+ --intent-contrast: var(--color-neutral-50);
145
+ --intent-hover: var(--color-violet-700);
146
+ --intent-strong: var(--color-violet-800);
147
+ --intent-subtle: var(--color-violet-100);
148
+ --intent-border: var(--color-violet-600);
149
+ --intent-fill-max: 100%;
150
+ }
151
+ ```
152
+
153
+ ```html
154
+ <button class="btn brand">Custom intent</button>
155
+ <span class="badge brand soft">Works everywhere</span>
156
+ ```
157
+
158
+ > **Intent does not cascade.** Components reset these slots to the text
159
+ > palette at their own root, so a `.success` container never recolors a
160
+ > nested destructive button. Put the intent class on the element that shows
161
+ > the intent.
162
+
163
+ ## Foundation tokens
164
+
165
+ Foundation tokens are not aliases for one color. They define layout, shape,
166
+ motion, focus, depth, and layering behavior used by helper classes.
167
+
168
+ The four `--elevation-*` values below are raw shadows for elements you style
169
+ yourself. They are a separate thing from `.elevation-none`/`.elevation-sm`/
170
+ `.elevation-md` (aliased as `.flat`/`.raised`/`.floating`), which scale a
171
+ _component's own_ shadow geometry and default to no shadow at all until an
172
+ aesthetic or one of those classes asks for depth — see
173
+ [Composing → Elevation](./composing.md#elevation) for that system. The two
174
+ share `none`/`sm`/`md`/`lg` naming for the same weight of depth, but one is a
175
+ fixed value and the other multiplies shadow parts, so they will not always
176
+ paint identically.
177
+
178
+ | Token | Purpose |
179
+ | -------------------------- | ----------------------------------------------------------------------- |
180
+ | `--font-default` | Default app font family. |
181
+ | `--container-narrow` | Narrow content width. |
182
+ | `--container-max` | Default content width. |
183
+ | `--container-wide` | Wide content width. |
184
+ | `--layout-gutter` | Responsive inline page padding. |
185
+ | `--layout-section-block` | Responsive section vertical padding. |
186
+ | `--layout-gap` | Shared gap for `.view`, `.stack`, `.cluster`, and `.auto-grid`. |
187
+ | `--layout-grid-min` | Minimum column width for `.auto-grid`. |
188
+ | `--radius-small` | Small radius for compact utility surfaces such as code elements. |
189
+ | `--radius-control` | Radius for buttons, inputs, tooltips, and compact UI. |
190
+ | `--radius-surface` | Radius for cards, panels, and alerts. |
191
+ | `--control-height` | Default minimum height for controls. |
192
+ | `--border-width` | Default border width. |
193
+ | `--elevation-color` | Shadow color the four elevations compose from. Heavier in dark themes. |
194
+ | `--elevation-none` | No shadow. Use on an element that should read as flat against its page. |
195
+ | `--elevation-sm` | A light shadow for your own surface-level elements, such as cards. |
196
+ | `--elevation-md` | A shadow for your own raised elements, such as dropdowns and popovers. |
197
+ | `--elevation-lg` | A shadow for your own full overlays, such as modal dialogs. |
198
+ | `--focus-ring` | Focus-visible ring color. |
199
+ | `--focus-ring-offset` | Focus-visible outline offset. Negative, so the ring lands on the edge. |
200
+ | `--focus-ring-width` | Focus-visible outline/ring width. |
201
+ | `--motion-duration-fast` | Fast transition for buttons and input interactions (`120ms`). |
202
+ | `--motion-duration-normal` | Normal transition for layout and modals (`200ms`). |
203
+ | `--motion-duration-slow` | Slow animation for skeleton loaders and progress bars (`400ms`). |
204
+ | `--motion-ease` | Default easing curve. |
205
+ | `--z-popover` | Popover/tooltip z-index. |
206
+ | `--breakpoint-xs` | Extra-small Tailwind responsive breakpoint. |
207
+ | `--breakpoint-2xl` | Extended large Tailwind responsive breakpoint. |
208
+
209
+ Next: [Customizing](./customizing.md) covers presentation and material
210
+ tokens — how much of an intent shows, and what a component is made of.
@@ -0,0 +1,45 @@
1
+ ---
2
+ title: Tooltips
3
+ description: Tooltip host classes and positioning attributes.
4
+ ---
5
+
6
+ # Tooltips
7
+
8
+ | Class or Attribute | Purpose |
9
+ | --------------------------------------- | -------------------------------------------------------------- |
10
+ | `.tooltip` | Tooltip host. Uses `data-tooltip` as pseudo-element content. |
11
+ | `.tooltip.tooltip-icon` | Circular icon-style tooltip host. |
12
+ | `[data-tooltip-position="top"]` | Positions tooltip above host. |
13
+ | `[data-tooltip-position="bottom"]` | Positions tooltip below host. |
14
+ | `[data-tooltip-position="left"]` | Positions tooltip left of host. |
15
+ | `[data-tooltip-position="right"]` | Positions tooltip right of host. |
16
+ | No `data-tooltip-position` | Defaults to top placement. |
17
+ | `[data-state="open"]` | Shows tooltip without hover. |
18
+ | `.tooltip.raised` / `.tooltip.floating` | Adds one or two units of depth. The bubble is flat by default. |
19
+
20
+ A tooltip bubble's fill, ground color, and floor behavior are covered in
21
+ [Composing → Presentation](./composing.md#presentation), and its material
22
+ follows whichever [aesthetic](./aesthetics.md) is in scope, including the
23
+ pseudo-element itself.
24
+
25
+ The bubble rests flat. It draws no shadow of its own on a plain page, and
26
+ zeroes an aesthetic's part-based depth (such as `.neobrutalism`'s slab) the
27
+ same way `.flat` does elsewhere. Add [`.raised` or
28
+ `.floating`](./composing.md#elevation) to lift it — `.tooltip.floating` is the
29
+ pre-0.1.0 look. An aesthetic whose shadow is a complete value, like `.glass`,
30
+ still reaches the bubble as it reaches any surface.
31
+
32
+ ```html
33
+ <button
34
+ class="tooltip tooltip-icon"
35
+ data-tooltip="More details"
36
+ data-tooltip-position="right"
37
+ aria-label="More details"
38
+ >
39
+ ?
40
+ </button>
41
+ ```
42
+
43
+ CSS pseudo-element tooltips are presentational. They are not a complete
44
+ accessible tooltip implementation by themselves — provide accessible
45
+ names/descriptions outside the CSS; see [Accessibility](../accessibility.md).