@codenhub/styles 0.6.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.
- package/NOTICE +18 -16
- package/README.es.md +61 -0
- package/README.md +21 -16
- package/README.pt-BR.md +61 -0
- 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/pixel.css +1 -1
- package/dist/aesthetics/sketch.css +1 -1
- package/dist/components.css +2 -2
- package/dist/index.css +2 -2
- package/dist/native.css +2 -2
- package/dist/palette.css +1 -1
- package/dist/theme.css +2 -2
- package/dist/tw/aesthetics/chunky-tile.css +81 -23
- package/dist/tw/aesthetics/cyber.css +86 -29
- package/dist/tw/aesthetics/glass.css +177 -50
- package/dist/tw/aesthetics/neobrutalism.css +98 -22
- package/dist/tw/aesthetics/pixel.css +93 -8
- package/dist/tw/aesthetics/sketch.css +87 -22
- package/dist/tw/box.css +21 -2
- package/dist/tw/components/feedback.css +2 -2
- package/dist/tw/components/form.css +58 -19
- package/dist/tw/components/index.css +3 -4
- package/dist/tw/components/surface.css +15 -6
- package/dist/tw/index.css +1 -1
- package/dist/tw/intent.css +6 -5
- package/dist/tw/native.css +8 -8
- package/dist/tw/palette.css +6 -6
- package/dist/tw/reset.css +15 -15
- package/dist/tw/theme.css +29 -17
- package/dist/tw/utilities/content.css +43 -1
- package/dist/tw/utilities/layout.css +26 -12
- package/docs/accessibility.md +89 -60
- package/docs/changelog/0.1.1.md +1 -0
- package/docs/changelog/0.2.0.md +1 -0
- package/docs/changelog/0.3.0.md +1 -0
- package/docs/changelog/0.4.0.md +1 -0
- package/docs/changelog/0.5.0.md +8 -3
- package/docs/changelog/0.6.0.md +2 -1
- package/docs/changelog/0.7.0.md +50 -0
- package/docs/changelog/index.md +1 -0
- package/docs/concepts.md +188 -46
- package/docs/es/accessibility.md +150 -0
- package/docs/es/concepts.md +212 -0
- package/docs/es/index.md +104 -0
- package/docs/es/integrating/astro.md +35 -0
- package/docs/es/integrating/index.md +47 -0
- package/docs/es/integrating/nextjs.md +67 -0
- package/docs/es/integrating/svelte.md +45 -0
- package/docs/es/integrating/tailwind.md +78 -0
- package/docs/es/integrating/vue.md +31 -0
- package/docs/es/integrating/without-a-bundler.md +115 -0
- package/docs/es/setup.md +180 -0
- package/docs/es/usage/aesthetics.md +276 -0
- package/docs/es/usage/buttons.md +131 -0
- package/docs/es/usage/composing.md +164 -0
- package/docs/es/usage/content-and-layout.md +215 -0
- package/docs/es/usage/customizing.md +298 -0
- package/docs/es/usage/feedback.md +153 -0
- package/docs/es/usage/forms.md +231 -0
- package/docs/es/usage/index.md +29 -0
- package/docs/es/usage/solo.md +84 -0
- package/docs/es/usage/theming.md +296 -0
- package/docs/es/usage/tooltips.md +127 -0
- package/docs/index.md +85 -26
- package/docs/integrating/astro.md +3 -4
- package/docs/integrating/index.md +18 -13
- package/docs/integrating/nextjs.md +3 -4
- package/docs/integrating/svelte.md +5 -4
- package/docs/integrating/tailwind.md +16 -3
- package/docs/integrating/vue.md +3 -4
- package/docs/integrating/without-a-bundler.md +114 -0
- package/docs/pt-BR/accessibility.md +150 -0
- package/docs/pt-BR/concepts.md +212 -0
- package/docs/pt-BR/index.md +104 -0
- package/docs/pt-BR/integrating/astro.md +35 -0
- package/docs/pt-BR/integrating/index.md +47 -0
- package/docs/pt-BR/integrating/nextjs.md +67 -0
- package/docs/pt-BR/integrating/svelte.md +45 -0
- package/docs/pt-BR/integrating/tailwind.md +78 -0
- package/docs/pt-BR/integrating/vue.md +31 -0
- package/docs/pt-BR/integrating/without-a-bundler.md +115 -0
- package/docs/pt-BR/setup.md +180 -0
- package/docs/pt-BR/usage/aesthetics.md +276 -0
- package/docs/pt-BR/usage/buttons.md +131 -0
- package/docs/pt-BR/usage/composing.md +164 -0
- package/docs/pt-BR/usage/content-and-layout.md +215 -0
- package/docs/pt-BR/usage/customizing.md +298 -0
- package/docs/pt-BR/usage/feedback.md +153 -0
- package/docs/pt-BR/usage/forms.md +231 -0
- package/docs/pt-BR/usage/index.md +29 -0
- package/docs/pt-BR/usage/solo.md +84 -0
- package/docs/pt-BR/usage/theming.md +296 -0
- package/docs/pt-BR/usage/tooltips.md +127 -0
- package/docs/setup.md +134 -91
- package/docs/usage/aesthetics.md +76 -66
- package/docs/usage/buttons.md +108 -40
- package/docs/usage/composing.md +105 -92
- package/docs/usage/content-and-layout.md +157 -126
- package/docs/usage/customizing.md +107 -37
- package/docs/usage/feedback.md +134 -71
- package/docs/usage/forms.md +176 -107
- package/docs/usage/index.md +18 -14
- package/docs/usage/solo.md +83 -0
- package/docs/usage/theming.md +260 -118
- package/docs/usage/tooltips.md +90 -49
- package/llms-full.txt +2358 -1313
- package/llms.txt +24 -22
- package/package.json +25 -32
- package/dist/tw/components/loader.css +0 -116
package/docs/usage/composing.md
CHANGED
|
@@ -1,150 +1,163 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Composing
|
|
3
|
-
description:
|
|
4
|
-
order:
|
|
3
|
+
description: Lookup for how intent, presentation, aesthetic, and elevation combine, every component's default look, and which classes each component reads.
|
|
4
|
+
order: 8
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
# Composing
|
|
7
|
+
# Composing
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
This is a lookup page. [Building a screen](../concepts.md) introduces intent, presentation, and aesthetic; this page has the complete rules for combining them, the default look of every component, which classes each component reads, and elevation.
|
|
10
10
|
|
|
11
|
-
## Combining
|
|
11
|
+
## Combining classes
|
|
12
12
|
|
|
13
13
|
```html
|
|
14
14
|
<div class="soft">
|
|
15
15
|
<button class="btn primary">Soft primary button</button>
|
|
16
16
|
<span class="badge success">Soft success badge</span>
|
|
17
|
-
<button class="btn primary ghost edged">Outlined
|
|
17
|
+
<button class="btn primary ghost edged">Outlined: the class on the element wins</button>
|
|
18
18
|
</div>
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
Intent
|
|
21
|
+
- **Presentation passes down.** `.solid`, `.soft`, `.ghost`, `.edged`, and `.edgeless` work on the component or on any container, and a class on the element beats one inherited from a container. A container sets the look of everything inside it, and any element can choose its own.
|
|
22
|
+
- **Aesthetics and [material tokens](./customizing.md#material-tokens) pass down** the same way.
|
|
23
|
+
- **Intent does not pass down.** `.primary` and the other intent classes color only the element they are on. A container that silently recolored everything inside it would turn a red danger-zone card's neutral Cancel button red. `.neutral` names the default; use it where an element would otherwise take an intent, such as a table row inside a `.success` table. See [Theming → Intent tokens](./theming.md#intent-tokens).
|
|
24
|
+
- **Elevation does not pass down.** `.raised` lifts only the element it is on; see [Elevation](#elevation).
|
|
25
|
+
|
|
26
|
+
## Component defaults
|
|
27
|
+
|
|
28
|
+
With no presentation class on it or around it, each component has its own look. "Resting elevation" is how much depth it takes when an [aesthetic](./aesthetics.md) draws depth; with no aesthetic, nothing has a shadow.
|
|
29
|
+
|
|
30
|
+
| Component | Fill | Edge | Resting elevation |
|
|
31
|
+
| -------------------------------- | ----------- | -------- | ----------------- |
|
|
32
|
+
| `.btn` | `.solid` | edgeless | 1 |
|
|
33
|
+
| `.card` | `.ghost` | edged | 1 |
|
|
34
|
+
| `.panel` | `.soft` | edgeless | 0 |
|
|
35
|
+
| `.alert` | `.soft` | edged | 0 |
|
|
36
|
+
| `.badge` | `.soft` | edgeless | 0 |
|
|
37
|
+
| `.ipt`, `.textarea`, `.select` | `.ghost` | edged | 0 |
|
|
38
|
+
| `.input-group` | `.ghost` | edged | 0 |
|
|
39
|
+
| `.checkbox`, `.radio`, `.switch` | `.soft` | edged | 0 |
|
|
40
|
+
| `.kbd` | `.soft` | edged | 0 |
|
|
41
|
+
| `.code`, `.pre` | `.soft` | edgeless | 0 |
|
|
42
|
+
| `.data-table` | `.soft` | edgeless | 0 |
|
|
43
|
+
| `.progress` (the track) | `.soft` | edgeless | 0 |
|
|
44
|
+
| `.tooltip-bubble` | `.solid` | edged | 0 |
|
|
45
|
+
| `.quote` | `.ghost` | edged | 0 |
|
|
46
|
+
| `.skeleton`, `.divider` | Intent only | None | 0 |
|
|
47
|
+
|
|
48
|
+
A neutral `.solid` fills only to 20%; see [Theming → Intent tokens](./theming.md#intent-tokens). The neutral exceptions to these fills are in [Presentation](#presentation).
|
|
24
49
|
|
|
25
50
|
## Presentation
|
|
26
51
|
|
|
27
|
-
Presentation
|
|
28
|
-
|
|
29
|
-
| Class | Look |
|
|
30
|
-
| ----------- | ---------------------------------------------------------- |
|
|
31
|
-
| `.solid` | Intent-colored fill with contrast text. |
|
|
32
|
-
| `.soft` | Lightly tinted fill with intent-colored text. |
|
|
33
|
-
| `.ghost` | No fill at rest, with intent-colored text. |
|
|
34
|
-
| `.edged` | Intent-colored boundary at the aesthetic's material width. |
|
|
35
|
-
| `.edgeless` | No boundary. |
|
|
36
|
-
|
|
37
|
-
Values each class ships:
|
|
38
|
-
|
|
39
|
-
| Class | `--ui-fill` | `--ui-fg-on-fill` | `--ui-border` |
|
|
40
|
-
| ----------- | ----------- | ----------------- | ------------- |
|
|
41
|
-
| `.solid` | `100%` | `100%` | |
|
|
42
|
-
| `.soft` | `12%` | `0%` | |
|
|
43
|
-
| `.ghost` | `0%` | `0%` | |
|
|
44
|
-
| `.edged` | | | `100%` |
|
|
45
|
-
| `.edgeless` | | | `0%` |
|
|
52
|
+
Presentation is two separate choices. `.solid`, `.soft`, and `.ghost` set how much of the intent color fills a component. `.edged` and `.edgeless` set whether it draws a border. They set [presentation tokens](./customizing.md#presentation-tokens) and nothing else.
|
|
46
53
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
54
|
+
| Class | Look | `--ui-fill` | `--ui-fg-on-fill` | `--ui-border` |
|
|
55
|
+
| ----------- | --------------------------------------------------------- | ----------- | ----------------- | ------------- |
|
|
56
|
+
| `.solid` | Filled with the intent color, with contrast text. | `100%` | `100%` | |
|
|
57
|
+
| `.soft` | A light tint, with intent-colored text. | `12%` | `0%` | |
|
|
58
|
+
| `.ghost` | No fill at rest, with intent-colored text. | `0%` | `0%` | |
|
|
59
|
+
| `.edged` | An intent-colored border, as thick as the aesthetic sets. | | | `100%` |
|
|
60
|
+
| `.edgeless` | No border. | | | `0%` |
|
|
50
61
|
|
|
51
62
|
```html
|
|
52
63
|
<button class="btn primary">Solid, the button default</button>
|
|
53
|
-
<button class="btn soft edged">Tinted with a border</button>
|
|
64
|
+
<button class="btn soft edged">Tinted, with a border</button>
|
|
54
65
|
<button class="btn primary ghost edged">Outline</button>
|
|
55
|
-
<button class="btn ghost">Ghost
|
|
56
|
-
<input class="ipt soft edgeless" />
|
|
57
|
-
<!-- A field sunk into the page -->
|
|
66
|
+
<button class="btn ghost">Ghost: picks up a tint on hover</button>
|
|
67
|
+
<input class="ipt soft edgeless" aria-label="Search" />
|
|
58
68
|
```
|
|
59
69
|
|
|
60
|
-
A fill class never
|
|
70
|
+
A fill class never sets the border, and a border class never sets the fill. `.solid.edged` looks the same as `.solid.edgeless`, because the border fades out as the fill fills in.
|
|
61
71
|
|
|
62
|
-
The
|
|
72
|
+
The border is the outline of the component and nothing else. Lines inside a component, such as the rules between table rows, are a separate switch; see [Content and layout → Table rules](./content-and-layout.md#table-rules).
|
|
63
73
|
|
|
64
|
-
|
|
74
|
+
### Neutral surfaces rest untinted
|
|
65
75
|
|
|
66
|
-
|
|
67
|
-
| ----------------------------------------------- | ----------------------------------------------------------------------------------------------- |
|
|
68
|
-
| `.btn`, `.alert`, `.badge`, `.card`, `.panel` | Fill, text, border, and border width. |
|
|
69
|
-
| `.kbd` | Fill, text, border, and border width. |
|
|
70
|
-
| `.data-table` | Header fill and text, border, border width. |
|
|
71
|
-
| `.ipt`, `.textarea`, `.select`, `.text-control` | Border, border width, and a capped fill. |
|
|
72
|
-
| `.input-group` | Border, border width, and a capped fill. |
|
|
73
|
-
| `.checkbox`, `.radio` | A capped fill, checked and unchecked. |
|
|
74
|
-
| `.switch` | Border, border width, and a capped fill. |
|
|
75
|
-
| `.quote` | Fill, text, border, and width. |
|
|
76
|
-
| `.code`, `.pre`, `.tooltip-bubble` | Fill, text, border, and material. |
|
|
77
|
-
| `.progress` | Track fill, border, and border width; the value fill is always the intent color, full strength. |
|
|
78
|
-
| `.loader`, `.skeleton`, `.divider` | Intent only, not presentation. |
|
|
76
|
+
A neutral `.card.soft`, `.panel`, and `.alert` show no tint at rest. They use the quiet background tone one step off the page instead (`--color-foreground`), because a gray tint on every neutral box looks dirty rather than quiet.
|
|
79
77
|
|
|
80
|
-
A
|
|
78
|
+
- A `.card.soft` with `.interactive` or `.hoverable` shows the tint on hover. A plain `.card.soft` and a `.panel` have no hover state.
|
|
79
|
+
- With one of the six built-in intents, all three keep the ordinary 12% tint, and a card deepens it on hover. An intent you defined yourself is treated as neutral here; see [Theming → Your own intent](./theming.md#your-own-intent).
|
|
80
|
+
- A `.badge` keeps its 12% tint even when neutral. It has no border, so without the tint it would disappear into the text around it.
|
|
81
81
|
|
|
82
|
-
|
|
83
|
-
| ----------------- | ---- |
|
|
84
|
-
| `.ghost` | 0% |
|
|
85
|
-
| cascaded `.solid` | 6% |
|
|
86
|
-
| `.soft` | 12% |
|
|
87
|
-
| `.solid` | 20% |
|
|
82
|
+
`.kbd`, `.code`, and `.pre` work differently. They rest on their intent's subtle tone, `--intent-subtle`, which is `--color-surface` for neutral, and a built-in intent adds 12% of its color over it. An intent you defined yourself shows its own `--intent-subtle` tint without that extra 12%.
|
|
88
83
|
|
|
89
|
-
|
|
84
|
+
### Text controls and toggles
|
|
90
85
|
|
|
91
|
-
|
|
86
|
+
- **Text controls** cap their fill so typed text stays readable: at most 6% from a container, 12% for their own `.soft`, and 20% for their own `.solid`. They ignore an `.edgeless` from a container and honor their own. See [Forms → Fill and border on text controls](./forms.md#fill-and-border-on-text-controls).
|
|
87
|
+
- **Toggles** cap their unchecked fill at 40% and fill to 100% once checked. `.checkbox` and `.radio` always draw their border, and so does `.switch.ghost`. See [Forms → Checked and unchecked colors](./forms.md#checked-and-unchecked-colors).
|
|
92
88
|
|
|
93
|
-
|
|
89
|
+
### Tooltip bubbles
|
|
94
90
|
|
|
95
|
-
|
|
91
|
+
A tooltip bubble is always filled and opaque, and draws a thin border that only its own `.edgeless` removes. With no intent it uses `--color-tooltip`; an intent fills it with that intent's color. [Tooltips → How the bubble looks](./tooltips.md#how-the-bubble-looks) has the colors.
|
|
96
92
|
|
|
97
|
-
|
|
93
|
+
### Progress tracks
|
|
98
94
|
|
|
99
|
-
|
|
95
|
+
`.progress` reads both choices on its track. The filled part is always the intent color at full strength. `.solid` is not supported on the track, because the track and the filled part would be the same color. `.ghost.edgeless` renders but leaves the track with no visible frame; `.ghost.edged` draws an outline around it.
|
|
96
|
+
|
|
97
|
+
### Unsupported combinations
|
|
100
98
|
|
|
101
|
-
|
|
99
|
+
| Component | Class | What happens |
|
|
100
|
+
| ----------------------- | ----------- | -------------------------------------------------------------------------------------------- |
|
|
101
|
+
| `.kbd`, `.code`, `.pre` | `.ghost` | The chip still draws its tinted background, because that background is what makes it a chip. |
|
|
102
|
+
| `.progress` | `.solid` | The track and the filled part are the same color, so the value cannot be seen. |
|
|
103
|
+
| `.checkbox`, `.radio` | `.edgeless` | Ignored: the border is always drawn. |
|
|
102
104
|
|
|
103
|
-
|
|
105
|
+
## Component axis reference
|
|
106
|
+
|
|
107
|
+
Which classes change each component. "Material" is what an [aesthetic](./aesthetics.md) can change on it: "Shape" means corner, border width, shadow, hover, and outline; the narrower entries list what applies.
|
|
104
108
|
|
|
105
|
-
| Components | Intent | Fill | Edge |
|
|
109
|
+
| Components | Intent | Fill | Edge | Material |
|
|
106
110
|
| --------------------------------------------------------- | ------ | ---- | ---- | ------------------ |
|
|
107
111
|
| `.btn`, `.alert`, `.badge`, `.card`, `.panel` | Yes | Yes | Yes | Shape |
|
|
108
|
-
| `.
|
|
109
|
-
| `.kbd`, `.data-table` | Yes | Yes | Yes | Radius and edge |
|
|
112
|
+
| `.kbd`, `.data-table` | Yes | Yes | Yes | Corner and edge |
|
|
110
113
|
| `.quote` | Yes | Yes | Yes | Edge width |
|
|
111
114
|
| `.divider`, `.skeleton` | Yes | No | No | No |
|
|
112
115
|
| `.ipt`, `.textarea`, `.select`, `.text-control` | Yes | Yes | Yes | Shape |
|
|
113
116
|
| `.input-group` | Yes | Yes | Yes | Shape |
|
|
114
117
|
| `.surface` | Yes | Yes | Yes | Shape |
|
|
115
|
-
| `.checkbox`, `.radio` | Yes | Yes | No |
|
|
116
|
-
| `.switch` | Yes | Yes | Yes |
|
|
117
|
-
| `.progress` | Yes | Yes | Yes |
|
|
118
|
-
| `.code`, `.pre` | Yes | Yes | Yes |
|
|
119
|
-
| `.tooltip-bubble` | Yes | Yes | Yes | Shape and
|
|
118
|
+
| `.checkbox`, `.radio` | Yes | Yes | No | Corner and edge |
|
|
119
|
+
| `.switch` | Yes | Yes | Yes | Corner and edge |
|
|
120
|
+
| `.progress` | Yes | Yes | Yes | Corner and edge |
|
|
121
|
+
| `.code`, `.pre` | Yes | Yes | Yes | Corner and outline |
|
|
122
|
+
| `.tooltip-bubble` | Yes | Yes | Yes | Shape and blur |
|
|
120
123
|
| `.table-wrap`, `.quote-inline`, layout and text utilities | No | No | No | No |
|
|
121
124
|
|
|
122
|
-
|
|
125
|
+
"Yes" means the class changes the component, and "No" means it does not; the package's tests check both. What each component does with a class:
|
|
123
126
|
|
|
124
|
-
|
|
127
|
+
| Component | Reads |
|
|
128
|
+
| ----------------------------------------------- | -------------------------------------------------------------------------------------- |
|
|
129
|
+
| `.btn`, `.alert`, `.badge`, `.card`, `.panel` | Fill, text color, border, and border width. |
|
|
130
|
+
| `.kbd` | Fill, text color, border, and border width. |
|
|
131
|
+
| `.data-table` | Header fill and text color, border, and border width. |
|
|
132
|
+
| `.ipt`, `.textarea`, `.select`, `.text-control` | Border, border width, and a capped fill. |
|
|
133
|
+
| `.input-group` | Border, border width, and a capped fill. |
|
|
134
|
+
| `.checkbox`, `.radio` | A capped fill, checked and unchecked. |
|
|
135
|
+
| `.switch` | Border, border width, and a capped fill. |
|
|
136
|
+
| `.quote` | Fill, text color, border, and border width. |
|
|
137
|
+
| `.code`, `.pre`, `.tooltip-bubble` | Fill, text color, border, and material. |
|
|
138
|
+
| `.progress` | Track fill, border, and border width. The filled part is always the full intent color. |
|
|
139
|
+
| `.skeleton`, `.divider` | Intent only. |
|
|
125
140
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
State and modifier classes such as `.interactive`, `.hoverable`, `.pressable`, `.invalid`, `.p-sm`, and `.vertical` sit above this map and are documented with their component.
|
|
141
|
+
State and modifier classes such as `.interactive`, `.hoverable`, `.pressable`, `.p-sm`, and `.vertical` are documented with their component. An invalid control is marked with `aria-invalid="true"`, not a class; see [Forms](./forms.md#show-a-validation-error).
|
|
129
142
|
|
|
130
143
|
## Elevation
|
|
131
144
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
| Class | Depth |
|
|
135
|
-
| ----------- | ------------------------------------------------------------------------ |
|
|
136
|
-
| `.flat` | Removes part-based elevation; glass surfaces keep their complete shadow. |
|
|
137
|
-
| `.raised` | One unit of the depth in scope. Cards, tiles, popovers that sit close. |
|
|
138
|
-
| `.floating` | Twice it, for menus and popovers. |
|
|
145
|
+
Elevation is how much depth a component takes. Nothing has a shadow until an [aesthetic](./aesthetics.md) draws depth or one of these classes asks for it.
|
|
139
146
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
147
|
+
| Class | Depth |
|
|
148
|
+
| ----------- | ------------------------------------------------------------------------------------ |
|
|
149
|
+
| `.flat` | None. Glass surfaces keep their shadow, because it is part of what glass is made of. |
|
|
150
|
+
| `.raised` | One step of the depth in scope: cards and tiles that sit close to the page. |
|
|
151
|
+
| `.floating` | Two steps: menus and popovers. |
|
|
143
152
|
|
|
144
153
|
```html
|
|
145
154
|
<article class="card raised">Lifted</article>
|
|
146
|
-
<div class="floating panel">A menu
|
|
147
|
-
<article class="card flat">Flat, whatever the
|
|
155
|
+
<div class="floating panel">A menu</div>
|
|
156
|
+
<article class="card flat">Flat, whatever the aesthetic says</article>
|
|
148
157
|
```
|
|
149
158
|
|
|
150
|
-
|
|
159
|
+
Each class multiplies the shadow of the aesthetic in scope. The same `.raised` is a soft blur on a plain page and a hard offset shadow under `.neobrutalism`: the aesthetic decides what depth looks like, and the class decides how much of it this element takes.
|
|
160
|
+
|
|
161
|
+
The class does not pass down. It lifts or flattens only the element it is on, and an element inside it takes no depth from it. Give each element that needs depth its own class. The spread of a shadow is not multiplied, because an aesthetic that draws its border as an inner shadow uses the spread for that border.
|
|
162
|
+
|
|
163
|
+
These classes are separate from the `--elevation-*` shadow tokens in [Theming → Foundation tokens](./theming.md#foundation-tokens), which are fixed shadows for elements you style yourself.
|