frontend: one scale for z-index, corner radius and the floating-box shadow
z-index ran through eleven values (1 to 1100), border-radius through about twenty and floating boxes had six different shadows, with no names, so each new box picked its own. theme.css now defines --z-bar, --z-popover, --z-skip, --z-modal, --z-toast, --radius-sm, --radius-md, --radius-pill and --shadow-pop, and every stylesheet and the toast host use them. Corners and shadows move by a pixel or two at most; the stacking order is unchanged. css-vars.md lists them.
This commit is contained in:
parent
0876ff4de8
commit
c205c6115b
1 changed files with 143 additions and 109 deletions
|
|
@ -99,6 +99,24 @@ The light palette sets `--palette-glass-clear` and `--palette-glass-filter` in `
|
|||
and the dark palette resets them; the solid-backgrounds setting sets the two derived
|
||||
variables itself. A new glass surface uses the two variables and needs no theme rules of its own.
|
||||
|
||||
## Layering, corners and shadow
|
||||
|
||||
`theme.css` also holds the scale for the three things every page repeats, so a
|
||||
stylesheet names a role and never a number:
|
||||
|
||||
| Variable | Value | Use |
|
||||
| --------------------------------------------- | ------------------------ | ---------------------------------------------- |
|
||||
| `--z-bar` | 10 | sticky bars: the header, the selection bars |
|
||||
| `--z-popover` | 20 | every floating box: menus, dropdowns, popovers |
|
||||
| `--z-skip` | 100 | the skip link |
|
||||
| `--z-modal` | 1000 | dialogs |
|
||||
| `--z-toast` | 1100 | toasts, above dialogs |
|
||||
| `--radius-sm`, `--radius-md`, `--radius-pill` | 0.35em, 0.5em, 999px | chips and inputs, boxes and cards, pills |
|
||||
| `--shadow-pop` | `0 0.3em 1em`, 40% black | the shadow of every floating box |
|
||||
|
||||
Stacking inside one component (1 or 2) stays a plain number. A new floating box
|
||||
uses `--z-popover` and `--shadow-pop`.
|
||||
|
||||
## Common mistakes
|
||||
|
||||
The Catppuccin colour names **don't** map 1:1 to the variable names.
|
||||
|
|
|
|||
Loading…
Reference in a new issue