@codenhub/styles 0.7.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.
- package/README.es.md +8 -7
- package/README.md +7 -6
- package/README.pt-BR.md +8 -7
- package/dist/aesthetics/chunky-tile.css +1 -1
- package/dist/aesthetics/cyber.css +1 -1
- package/dist/aesthetics/glass.css +1 -1
- package/dist/aesthetics/index.css +2 -2
- package/dist/aesthetics/neobrutalism.css +1 -1
- package/dist/aesthetics/sketch.css +1 -1
- package/dist/cli.js +189 -0
- package/dist/components.css +2 -2
- package/dist/index.css +2 -2
- package/dist/index.d.ts +1 -0
- package/dist/native.css +2 -2
- package/dist/palette.css +1 -1
- package/dist/theme.css +2 -2
- package/docs/accessibility.md +46 -27
- package/docs/changelog/0.8.0.md +70 -0
- package/docs/changelog/index.md +1 -0
- package/docs/es/accessibility.md +47 -28
- package/docs/es/index.md +3 -2
- package/docs/es/integrating/index.md +38 -10
- package/docs/es/integrating/tailwind.md +78 -8
- package/docs/es/integrating/without-a-bundler.md +128 -5
- package/docs/es/setup.md +42 -34
- package/docs/es/usage/aesthetics.md +19 -13
- package/docs/es/usage/buttons.md +6 -2
- package/docs/es/usage/composing.md +6 -2
- package/docs/es/usage/content-and-layout.md +8 -4
- package/docs/es/usage/customizing.md +19 -13
- package/docs/es/usage/feedback.md +5 -1
- package/docs/es/usage/forms.md +29 -4
- package/docs/es/usage/index.md +6 -2
- package/docs/es/usage/presets.md +92 -0
- package/docs/es/usage/solo.md +4 -2
- package/docs/es/usage/theming.md +28 -15
- package/docs/index.md +2 -1
- package/docs/integrating/index.md +38 -10
- package/docs/integrating/tailwind.md +77 -7
- package/docs/integrating/without-a-bundler.md +127 -4
- package/docs/pt-BR/accessibility.md +47 -28
- package/docs/pt-BR/index.md +3 -2
- package/docs/pt-BR/integrating/index.md +38 -10
- package/docs/pt-BR/integrating/tailwind.md +78 -8
- package/docs/pt-BR/integrating/without-a-bundler.md +128 -5
- package/docs/pt-BR/setup.md +42 -34
- package/docs/pt-BR/usage/aesthetics.md +19 -13
- package/docs/pt-BR/usage/buttons.md +6 -2
- package/docs/pt-BR/usage/composing.md +6 -2
- package/docs/pt-BR/usage/content-and-layout.md +8 -4
- package/docs/pt-BR/usage/customizing.md +19 -13
- package/docs/pt-BR/usage/feedback.md +5 -1
- package/docs/pt-BR/usage/forms.md +29 -4
- package/docs/pt-BR/usage/index.md +6 -2
- package/docs/pt-BR/usage/presets.md +92 -0
- package/docs/pt-BR/usage/solo.md +4 -2
- package/docs/pt-BR/usage/theming.md +21 -8
- package/docs/setup.md +30 -22
- package/docs/usage/aesthetics.md +18 -12
- package/docs/usage/buttons.md +5 -1
- package/docs/usage/composing.md +5 -1
- package/docs/usage/content-and-layout.md +7 -3
- package/docs/usage/customizing.md +18 -12
- package/docs/usage/feedback.md +4 -0
- package/docs/usage/forms.md +28 -3
- package/docs/usage/index.md +5 -1
- package/docs/usage/presets.md +91 -0
- package/docs/usage/solo.md +3 -1
- package/docs/usage/theming.md +20 -7
- package/llms-full.txt +592 -115
- package/package.json +113 -63
- package/{dist/tw → tw}/aesthetics/chunky-tile.css +39 -19
- package/{dist/tw → tw}/aesthetics/cyber.css +15 -24
- package/{dist/tw → tw}/aesthetics/glass.css +105 -36
- package/{dist/tw → tw}/aesthetics/neobrutalism.css +37 -20
- package/{dist/tw → tw}/aesthetics/sketch.css +152 -133
- package/{dist/tw → tw}/box.css +89 -12
- package/tw/components/button.css +11 -0
- package/tw/components/button.rules.css +187 -0
- package/tw/components/feedback.css +11 -0
- package/{dist/tw/components/feedback.css → tw/components/feedback.rules.css} +134 -30
- package/tw/components/form.css +11 -0
- package/{dist/tw/components/form.css → tw/components/form.rules.css} +524 -111
- package/tw/components/index.css +16 -0
- package/tw/components/rules.css +41 -0
- package/tw/components/surface.css +11 -0
- package/tw/components/surface.rules.css +222 -0
- package/tw/components/tooltip.css +11 -0
- package/{dist/tw/components/tooltip.css → tw/components/tooltip.rules.css} +43 -27
- package/{dist/tw → tw}/corner.css +18 -12
- package/{dist/tw → tw}/elevation.css +23 -17
- package/{dist/tw → tw}/index.css +11 -9
- package/tw/index.d.ts +1 -0
- package/tw/intent.css +312 -0
- package/tw/modifiers.css +127 -0
- package/tw/native.css +320 -0
- package/tw/presentation.css +139 -0
- package/tw/reset.css +10 -0
- package/{dist/tw/reset.css → tw/reset.rules.css} +7 -8
- package/tw/size.css +34 -0
- package/tw/surface.css +9 -0
- package/tw/surface.rules.css +212 -0
- package/{dist/tw → tw}/theme.css +92 -28
- package/tw/typography.css +8 -0
- package/{dist/tw/typography.css → tw/typography.rules.css} +0 -3
- package/{dist/tw → tw}/utilities/content.css +183 -63
- package/tw/utilities/index.css +11 -0
- package/tw/utilities/layout.css +208 -0
- package/tw/utilities/rules.css +8 -0
- package/dist/tw/components/button.css +0 -139
- package/dist/tw/components/index.css +0 -35
- package/dist/tw/components/surface.css +0 -184
- package/dist/tw/intent.css +0 -229
- package/dist/tw/native.css +0 -203
- package/dist/tw/palette.css +0 -460
- package/dist/tw/presentation.css +0 -68
- package/dist/tw/surface.css +0 -61
- package/dist/tw/utilities/index.css +0 -6
- package/dist/tw/utilities/layout.css +0 -144
- /package/{dist/tw → tw}/aesthetics/index.css +0 -0
- /package/{dist/tw → tw}/aesthetics/pixel.css +0 -0
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Presets
|
|
3
|
+
description: Three ways to set a look once instead of on every element, and when to reach for each.
|
|
4
|
+
order: 11
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Presets
|
|
8
|
+
|
|
9
|
+
By now the settings screen says `btn primary soft sm` in a dozen places, and changing your mind means changing a dozen places. This page covers the three ways to set a look once: axis classes on a container, theme and material tokens, and your own component classes built with `@apply`. Each fits a different kind of "once".
|
|
10
|
+
|
|
11
|
+
## Which one to use
|
|
12
|
+
|
|
13
|
+
| You want | Reach for |
|
|
14
|
+
| --------------------------------------------------------------------- | ----------------------------------------------------------- |
|
|
15
|
+
| Every component in one region to share a fill, an edge, or a material | [Axis classes on a container](#axis-classes-on-a-container) |
|
|
16
|
+
| Different colors, corners, borders, or depth for a page or a region | [Theme and material tokens](#theme-and-material-tokens) |
|
|
17
|
+
| One name for a recipe you repeat, such as "the save button" | [Your own component classes](#your-own-component-classes) |
|
|
18
|
+
|
|
19
|
+
They combine. A region can set a material token, sit under an aesthetic, and hold your own button class, and each element can still override what it inherits.
|
|
20
|
+
|
|
21
|
+
## Axis classes on a container
|
|
22
|
+
|
|
23
|
+
Some classes work on a container as well as on a component, and everything inside takes them:
|
|
24
|
+
|
|
25
|
+
- The presentation classes: `.solid`, `.soft`, `.ghost`, `.edged`, and `.edgeless`.
|
|
26
|
+
- The corner patterns: `.cut-diagonal` and `.cut-diagonal-reverse`.
|
|
27
|
+
- The [aesthetics](./aesthetics.md), such as `.glass` or `.pixel`.
|
|
28
|
+
|
|
29
|
+
```html
|
|
30
|
+
<div class="cluster soft edged">
|
|
31
|
+
<button class="btn primary" type="button">Bold</button>
|
|
32
|
+
<button class="btn" type="button">Italic</button>
|
|
33
|
+
<button class="btn destructive solid" type="button">Clear formatting</button>
|
|
34
|
+
</div>
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
The toolbar's buttons are soft and edged, and the last one asks for its own fill. A class on the element always beats one from a container.
|
|
38
|
+
|
|
39
|
+
The other axes do not pass down. Intent, elevation (`.flat`, `.raised`, `.floating`), and size (`.sm`, `.lg`) change only the element they are on, so a `.sm` toolbar does not shrink its buttons; [Composing → Combining classes](./composing.md#combining-classes) explains why. An aesthetic class also sets its own corner pattern on its region, so a `.cut-diagonal` above a `.pixel` region does not reach inside it.
|
|
40
|
+
|
|
41
|
+
Use a container class when the look belongs to the region, such as a quiet sidebar, rather than to the components in it.
|
|
42
|
+
|
|
43
|
+
## Theme and material tokens
|
|
44
|
+
|
|
45
|
+
Tokens are CSS custom properties. Set one on `:root` and the whole page follows; set it on an element and only what is inside follows. They reach further than classes, because components read them while they draw:
|
|
46
|
+
|
|
47
|
+
```css
|
|
48
|
+
.admin {
|
|
49
|
+
--radius-control: 0.25rem;
|
|
50
|
+
--radius-surface: 0.5rem;
|
|
51
|
+
--border-width: 2px;
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Every button, field, tooltip bubble, and surface inside `.admin` takes the tighter corners and the heavier border, with no class on any of them. Checkboxes, `.kbd`, and `.code` keep their own smaller corner, `--radius-small`.
|
|
56
|
+
|
|
57
|
+
The tables live where the tokens are explained, so this page does not repeat them:
|
|
58
|
+
|
|
59
|
+
- [Theming → Color tokens](./theming.md#color-tokens): brand and status colors, in both themes.
|
|
60
|
+
- [Theming → Foundation tokens](./theming.md#foundation-tokens): corners, border width, control height, focus ring, depth, and motion.
|
|
61
|
+
- [Customizing → Presentation tokens](./customizing.md#presentation-tokens): how much a fill, an edge, or a hover gives.
|
|
62
|
+
- [Customizing → Material tokens](./customizing.md#material-tokens): what an aesthetic sets, which you can set yourself, such as `--ui-radius`.
|
|
63
|
+
- [Customizing → Aesthetic tokens](./customizing.md#aesthetic-tokens): the knobs of each aesthetic, such as `--neo-offset`.
|
|
64
|
+
|
|
65
|
+
Use tokens when the change is a value, such as a color or a corner, rather than a choice between classes.
|
|
66
|
+
|
|
67
|
+
## Your own component classes
|
|
68
|
+
|
|
69
|
+
With the Tailwind source entrypoints, every component, helper, and axis class is a Tailwind utility, so one class of yours can carry the whole recipe:
|
|
70
|
+
|
|
71
|
+
```css
|
|
72
|
+
@import "@codenhub/styles/tw";
|
|
73
|
+
|
|
74
|
+
@utility btn-save {
|
|
75
|
+
@apply btn primary soft sm;
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
```html
|
|
80
|
+
<button class="btn-save" type="submit">Save changes</button>
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
`btn-save` behaves like `btn primary soft sm` written out, aesthetics and hover included, and changing the recipe changes every save button. Modifiers that belong to one component, such as `.tight` on `.stack` or `.icon` on `.btn`, are utilities too, so `@apply btn icon` gives you an icon button of your own. [Tailwind CSS v4 → Build your own components with `@apply`](../integrating/tailwind.md#build-your-own-components-with-apply) has the rules, including why `@utility` beats a plain rule.
|
|
84
|
+
|
|
85
|
+
With the compiled CSS there is no `@apply`. Keep the recipe in one place on the other side instead: a template partial, a component in your framework, or a constant such as `const saveButton = "btn primary soft sm"`.
|
|
86
|
+
|
|
87
|
+
Use your own class when the same combination names one thing in your design, such as the save button or the plan card.
|
|
88
|
+
|
|
89
|
+
## Next
|
|
90
|
+
|
|
91
|
+
[Accessibility](../accessibility.md) lists what the CSS does for your users and what your application still owes them.
|
package/docs/usage/solo.md
CHANGED
|
@@ -76,7 +76,9 @@ With none of those classes, a solo class paints the material alone (edge, corner
|
|
|
76
76
|
## How it wins and when it moves
|
|
77
77
|
|
|
78
78
|
- **It beats the other library's styles.** The rules are unlayered and one class deep, so they win over a component's layered rules, and over its zero-specificity ones, wherever the two load. An unlayered foreign rule that is more specific, or as specific and later in the page, still wins. The other side of this is that a Tailwind utility on the same element, such as `rounded-none`, loses to the solo class: tune it through its knobs instead.
|
|
79
|
-
- **It presses only an action.** Neobrutalism, chunky tile, and cyber press a `button`, `a[href]`, `[role="button"]`, `summary`, or button-type `input` that is not disabled. Anything else stays put, so a toast does not sink when clicked.
|
|
79
|
+
- **It presses only an action.** Neobrutalism, chunky tile, and cyber press a `button`, `a[href]`, `[role="button"]`, `summary`, or button-type `input` that is not disabled. Anything else stays put, so a toast does not sink when clicked. Chunky tile's heavier label follows the same rule.
|
|
80
|
+
- **It leaves a container's motion alone.** Only an action takes the press's `transition`, and the press moves the element through the `translate` and `scale` properties, not `transform`. A toast keeps its own transitions and its own `transform`. On an action, the press's `transition` replaces any the element had.
|
|
81
|
+
- **Reduced motion keeps the press and drops its motion.** Under `prefers-reduced-motion: reduce`, neobrutalism, chunky tile, and cyber still press, but at once: the element lands in its shadow or bar, or shrinks, without travelling there.
|
|
80
82
|
|
|
81
83
|
## Next
|
|
82
84
|
|
package/docs/usage/theming.md
CHANGED
|
@@ -29,17 +29,26 @@ A settings screen with a "System / Light / Dark" choice removes the attribute fo
|
|
|
29
29
|
|
|
30
30
|
How it resolves:
|
|
31
31
|
|
|
32
|
-
- A theme selector sets the CSS `color-scheme` property and
|
|
33
|
-
- `color-scheme` inherits, so a selector themes everything inside it. A selector on any element themes that part of the page: a dark sidebar on a light page is `<aside class="dark"
|
|
32
|
+
- A theme selector sets the CSS `color-scheme` property, and the element's text color to `--color-text`. Every color token holds its light and its dark value at once, through `light-dark()`, and the element's `color-scheme` picks one.
|
|
33
|
+
- `color-scheme` inherits, so a selector themes everything inside it. A selector on any element themes that part of the page: a dark sidebar on a light page is `<aside class="dark">`, and the text inside it takes the dark theme's text color.
|
|
34
|
+
- A selector sets no background. Give the region its ground yourself, such as `background: var(--color-background)`. Any utility or component class on the same element overrides the selector's text color.
|
|
34
35
|
- The nearest selector wins, at any depth. A `.light` card inside a `.dark` page is light.
|
|
35
36
|
- With no selector, the root has `color-scheme: light dark`, which follows the system.
|
|
36
37
|
- Put one theme on an element. If an element carries both a light and a dark selector, dark wins, but do not rely on that.
|
|
37
|
-
- Setting `color-scheme` yourself on an element
|
|
38
|
+
- Setting `color-scheme` yourself on an element themes the tokens the same way, because it is the only thing the palette reads. It also themes native parts such as scrollbars and the inside of form controls. Plain text inside keeps the color it inherited until you also set `color: var(--color-text)`.
|
|
38
39
|
|
|
39
40
|
Every component color comes from a token or from `currentColor`, so components follow the theme with no dark-mode rules of their own. The marks the package draws, such as the checkbox tick and the select arrow, use `currentColor` too. Icons and images you add are yours to theme.
|
|
40
41
|
|
|
41
42
|
`light-dark()` works from Chrome 123, Safari 17.5, and Firefox 120. The package as a whole needs Firefox 128; see [Setup → Requirements](../setup.md#requirements).
|
|
42
43
|
|
|
44
|
+
### Printing
|
|
45
|
+
|
|
46
|
+
A page prints in the light theme, whatever theme it shows on screen. Under `@media print`, the root and every dark selector set `color-scheme: light`, so every token resolves to its light value, a forced-dark sidebar's included. Paper is light, and dark text on it costs less ink than a printed dark page.
|
|
47
|
+
|
|
48
|
+
Filled components print their background. A browser drops backgrounds from a printed page by default, which leaves a solid button's contrast text on nothing, so every component sets `print-color-adjust: exact`. The property inherits, so the content inside a component keeps its colors too.
|
|
49
|
+
|
|
50
|
+
One limit: a `dark:` utility still applies in print. It matches by selector, not by `color-scheme`, so `<html class="dark">` with `dark:bg-black` on an element prints that background black. Write a `print:` utility beside it if the printed page matters.
|
|
51
|
+
|
|
43
52
|
### The `dark:` variant
|
|
44
53
|
|
|
45
54
|
With the Tailwind source entrypoints (`/tw`), the package replaces Tailwind's `dark:` variant so your own utilities follow the same theme as the tokens. A `dark:` utility applies under an explicit dark selector on the element or an ancestor, or under a dark system preference when no ancestor sets a theme:
|
|
@@ -91,6 +100,8 @@ The same pattern works for every family in [Color tokens](#color-tokens): `--col
|
|
|
91
100
|
|
|
92
101
|
The values must be complete colors: hex, `rgb()`, `oklch()`, or a variable you declared yourself. Tailwind palette variables such as `--color-teal-700` exist in a `/tw` build, from your Tailwind theme, but the compiled CSS declares only the palette colors the package itself uses. With compiled CSS, a reference to any other palette variable is empty, and the color it feeds is lost.
|
|
93
102
|
|
|
103
|
+
With `/tw`, you can drop the Tailwind hues your design does not use, so `bg-red-500` and its siblings stop being classes. Keep the ones the theme reads, `neutral`, `emerald`, `amber`, `rose`, `indigo`, and `white`: cleared, the colors built from them are lost without an error. [Tailwind CSS v4 → Drop Tailwind's palette](../integrating/tailwind.md#drop-tailwinds-palette) has the block to copy.
|
|
104
|
+
|
|
94
105
|
## Your own intent
|
|
95
106
|
|
|
96
107
|
The package ships six intents: `.primary`, `.secondary`, `.success`, `.warning`, `.destructive`, and `.info`, and the default, `.neutral`. To add one, such as a "Beta" color for features in preview, write a class that sets the seven intent slots. Use complete colors, with `light-dark()` for anything that changes between themes:
|
|
@@ -120,6 +131,8 @@ The class works on everything that takes an intent: buttons, badges, fields and
|
|
|
120
131
|
- **A quiet, untinted rest.** A neutral `.card.soft`, `.panel`, and `.alert` rest on the quiet background tone, and they recognize an intent only by the six built-in classes. `.card.soft.beta`, `.panel.beta`, and `.alert.beta` are drawn like the neutral one: the quiet background tone instead of a violet tint. Your intent still colors their text and border.
|
|
121
132
|
- **The chip tint.** A `.beta` key cap or code block shows your `--intent-subtle` tint, but not the extra 12% of `--intent-color` a built-in intent adds over it.
|
|
122
133
|
- **Solo classes.** A [solo class](./solo.md) such as `.neobrutalism-solo` takes an intent only from the six built-in classes, so `.neobrutalism-solo.beta` is drawn neutral.
|
|
134
|
+
- **Hint text.** A [`.hint`](./forms.md#show-a-validation-error) prints in an intent's readable tone only for the six built-in classes, so `.hint.beta` stays secondary-colored.
|
|
135
|
+
- **Table rows.** A body row recolors its text, line, and hover only for the built-in intent classes. `<tr class="beta">` looks like the rest of its table.
|
|
123
136
|
|
|
124
137
|
If you need those, there are two ways:
|
|
125
138
|
|
|
@@ -232,7 +245,7 @@ The four `--elevation-*` shadows are for elements you style yourself. They are s
|
|
|
232
245
|
| `--elevation-sm` | `0 1px 2px`, `0 1px 3px` | A light shadow for your own surfaces, such as a card. |
|
|
233
246
|
| `--elevation-md` | `0 4px 6px -1px`, `0 2px 4px -2px` | A shadow for your own raised elements, such as a dropdown menu. |
|
|
234
247
|
| `--elevation-lg` | `0 20px 25px -5px`, `0 8px 10px -6px` | A shadow for your own overlays, such as a modal dialog. |
|
|
235
|
-
| `--focus-ring` | `--color-primary` at 64% opacity
|
|
248
|
+
| `--focus-ring` | Not set | Color of the keyboard focus ring. When unset, `--color-primary` at 64% opacity, on the focused element. |
|
|
236
249
|
| `--focus-ring-offset` | Not set | Distance of the ring from the element. When unset, the ring sits on the element's border under every aesthetic. |
|
|
237
250
|
| `--focus-ring-width` | `3px` | Width of the keyboard focus ring. |
|
|
238
251
|
| `--motion-duration-fast` | `120ms` | A table row's hover. |
|
|
@@ -242,7 +255,7 @@ The four `--elevation-*` shadows are for elements you style yourself. They are s
|
|
|
242
255
|
| `--z-popover` | `40` | Stacking order of tooltip bubbles. Use it for your own popovers so they stack the same way. |
|
|
243
256
|
| `--breakpoint-xs` | `30rem` | The `xs:` responsive breakpoint. Only in a `/tw` build; the compiled entrypoints do not declare it. |
|
|
244
257
|
|
|
245
|
-
Each `--elevation-*` shadow is made of the listed parts, each in `--elevation-color`. The hover step that deepens a fill under the pointer is a presentation token, `--hover-step`; see [Customizing](./customizing.md#presentation-tokens).
|
|
258
|
+
Each `--elevation-*` shadow is made of the listed parts, each in `--elevation-color`. The four shadows are composed once, on the root, so an `--elevation-color` you set on a container does not reach them: set it on `:root`, or set the `--elevation-*` token itself on the container. The elevation classes, such as `.card.raised`, read `--elevation-color` on the element and follow a container's value, with one exception: every aesthetic class sets its own `--elevation-color` on its region. A value set above a `.glass` or `.pixel` region does not reach inside it. Set it on the aesthetic's element itself, where your utility or unlayered CSS beats the class, or on an element inside the region. Under glass, a surface's shadow is built on the `.glass` element, so only a value set there changes it. Under `.neobrutalism` the shadow is drawn in the intent or the ink, and `.cyber` draws no depth, so neither reads the token. The hover step that deepens a fill under the pointer is a presentation token, `--hover-step`; see [Customizing](./customizing.md#presentation-tokens).
|
|
246
259
|
|
|
247
260
|
## Fonts
|
|
248
261
|
|
|
@@ -250,14 +263,14 @@ The package ships no font files and makes no network requests. Every font token
|
|
|
250
263
|
|
|
251
264
|
| Token | Read by | Without your value |
|
|
252
265
|
| ---------------- | ------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
253
|
-
| `--font-default` | The reset, on `html` and `body`.
|
|
266
|
+
| `--font-default` | The reset, on `html` and `body`, and `.glass` and `.neobrutalism` regions. Controls inherit it. | `"Segoe UI", system-ui, sans-serif` |
|
|
254
267
|
| `--font-mono` | The `kbd`, `code`, and `pre` content helpers, and `<kbd>`, `<code>`, and `<pre>` under `/native` | `ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace`. Under `/tw`, your Tailwind theme's value. |
|
|
255
268
|
| `--font-pixel` | [`.pixel`](./aesthetics.md#pixel) and `.pixel-solo` | Not declared. Falls back to a monospace stack. |
|
|
256
269
|
| `--font-rounded` | [`.chunky-tile`](./aesthetics.md#chunky-tile) and `.chunky-tile-solo` | Not declared. Falls back to `--font-default`, then a sans-serif stack. |
|
|
257
270
|
| `--font-cyber` | [`.cyber`](./aesthetics.md#cyber) and `.cyber-solo` | Not declared. Falls back to a monospace stack. |
|
|
258
271
|
| `--font-sketch` | [`.sketch`](./aesthetics.md#sketch) and `.sketch-solo` | Not declared. Falls back to the platform `cursive` family. |
|
|
259
272
|
|
|
260
|
-
`--font-default` reaches the page only through the reset, which `@codenhub/styles`, `/native`, `/tw`, `/tw/native`, and `/tw/reset` include. With `/theme` or `/components` alone, set `font-family` on `body` yourself. The aesthetic tokens are read by the aesthetic's own class, so they work with any entrypoint.
|
|
273
|
+
`--font-default` reaches the page only through the reset, which `@codenhub/styles`, `/native`, `/tw`, `/tw/native`, and `/tw/reset` include. With `/theme` or `/components` alone, set `font-family` on `body` yourself, and set `--font-default` to the same font: `.glass` and `.neobrutalism` regions set their own `font-family` from the token, so a font set only on `body` does not reach inside them. Or set only the token, and write `font-family: var(--font-default)` on `body`. The aesthetic tokens are read by the aesthetic's own class, so they work with any entrypoint.
|
|
261
274
|
|
|
262
275
|
To use a web font, load it the way you load any font, then name it in the token. Set the token on `:root` for the whole page, or on any element for that part of it:
|
|
263
276
|
|