Watch
0
0
Fork
You've already forked hyperhive
0

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:
iris 2026-11-25 21:29:08 +01:00
commit c205c6115b
15 changed files with 143 additions and 109 deletions

View file

@ -10,7 +10,7 @@
gap: 0.4em;
padding: 0.75em 1em;
border: 1px solid var(--border);
border-radius: 0.5em;
border-radius: var(--radius-md);
background: var(--bg-elev);
}
.ui-badge-popover-help {

View file

@ -4,7 +4,7 @@
gap: 0.35em;
padding: 0.75em 1em;
border: 1px solid var(--border);
border-radius: 0.5em;
border-radius: var(--radius-md);
background: var(--bg-elev);
}
/* Only an interactive `Card` (has `onClick`) gets pointer/hover

View file

@ -29,7 +29,7 @@
overflow: auto;
padding: 1.5em;
border: 1px solid var(--border);
border-radius: 0.6em;
border-radius: var(--radius-md);
background: var(--bg-elev);
color: var(--fg);
}
@ -56,7 +56,7 @@
width: 2.75em;
height: 2.75em;
border: 1px solid transparent;
border-radius: 0.4em;
border-radius: var(--radius-sm);
background: none;
color: var(--fg);
font-size: 1em;

View file

@ -17,7 +17,7 @@
.ui-disclosure-summary:focus-visible {
outline: 2px solid var(--blue);
outline-offset: -2px;
border-radius: 0.5em;
border-radius: var(--radius-md);
}
.ui-disclosure-hint {
min-width: 0;

View file

@ -9,7 +9,7 @@
background: var(--bg);
color: var(--fg);
border: 1px solid var(--border);
border-radius: 4px;
border-radius: var(--radius-sm);
padding: 0.35em 0.6em;
font: inherit;
font-size: 0.9em;
@ -29,7 +29,7 @@
.ui-filterable-view-filter-card {
padding: 0.75em 1em;
border: 1px solid var(--border);
border-radius: 0.5em;
border-radius: var(--radius-md);
background: var(--bg-elev);
margin-bottom: 0.5em;
}

View file

@ -38,7 +38,7 @@
background: var(--bg);
color: var(--fg);
border: 1px solid var(--purple-dim);
border-radius: 0.3em;
border-radius: var(--radius-sm);
padding: 0.4em 0.6em;
font: inherit;
width: 100%;

View file

@ -45,11 +45,11 @@
top: 100%;
left: 0;
margin-top: 0.25em;
z-index: 10;
z-index: var(--z-popover);
min-width: 12em;
padding: 0.5em;
background: var(--bg-elev);
border: 1px solid var(--border);
border-radius: 6px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
border-radius: var(--radius-md);
box-shadow: var(--shadow-pop);
}

View file

@ -1,6 +1,6 @@
.ui-panel {
border: 1px solid var(--border);
border-radius: 0.5em;
border-radius: var(--radius-md);
background: var(--bg-elev);
}
.ui-panel-header {
@ -59,7 +59,7 @@
width: 1.8em;
height: 1.8em;
border: 1px solid transparent;
border-radius: 0.4em;
border-radius: var(--radius-sm);
background: none;
color: var(--fg);
font-size: 1em;

View file

@ -4,12 +4,12 @@
size to the viewport. */
.ui-popover {
position: fixed;
z-index: 30;
z-index: var(--z-popover);
box-sizing: border-box;
width: 28em;
max-width: calc(100vw - 1em);
max-height: calc(100vh - 4em);
overflow: auto;
border-radius: 0.5em;
box-shadow: 0 0.4em 1.2em rgba(0, 0, 0, 0.45);
border-radius: var(--radius-md);
box-shadow: var(--shadow-pop);
}

View file

@ -3,7 +3,7 @@
padding: 0.6em 0.75em;
overflow: auto;
border: 1px solid var(--border, currentColor);
border-radius: 0.4em;
border-radius: var(--radius-sm);
background: color-mix(in srgb, var(--code-bg) 60%, transparent);
font-family: var(--mono, ui-monospace, monospace);
font-size: 0.85em;

View file

@ -10,7 +10,7 @@
min-height: 2.75em;
padding: 0 0.6em;
border: 1px solid transparent;
border-radius: 0.4em;
border-radius: var(--radius-sm);
color: var(--muted);
font-size: 0.9em;
}

View file

@ -58,8 +58,8 @@
background: var(--bg-elev);
color: var(--fg);
border: 1px solid var(--purple-dim);
border-radius: 0.4em;
box-shadow: 0 0.25em 0.75em rgba(0, 0, 0, 0.3);
border-radius: var(--radius-sm);
box-shadow: var(--shadow-pop);
font: inherit;
}
.ui-select-option {
@ -69,7 +69,7 @@
gap: 0.75em;
min-height: 2.5em;
padding: 0.3em 0.6em;
border-radius: 0.3em;
border-radius: var(--radius-sm);
cursor: pointer;
}
.ui-select-option-active {

View file

@ -5,7 +5,7 @@
the shape is a plain tinted block. */
.ui-skeleton {
display: block;
border-radius: 0.3em;
border-radius: var(--radius-sm);
background-color: color-mix(in srgb, var(--muted) 22%, transparent);
background-image: linear-gradient(
90deg,
@ -26,7 +26,7 @@
border-radius: 50%;
}
.ui-skeleton-block {
border-radius: 0.5em;
border-radius: var(--radius-md);
}
@keyframes ui-skeleton-shimmer {
to {
@ -80,7 +80,7 @@
box-sizing: border-box; /* as the button it stands in for */
min-height: 2.75em;
padding-inline: 0.8em;
border-radius: 999px;
border-radius: var(--radius-pill);
}
.ui-skeleton-badge .ui-skeleton {
display: inline-block;

View file

@ -93,7 +93,7 @@
padding: 0.15em;
background: none;
border: none;
border-radius: 4px;
border-radius: var(--radius-sm);
color: var(--muted);
cursor: pointer;
opacity: 0;
@ -124,13 +124,13 @@
sits alongside them as a `document.body`-level sibling rather than
nested inside the table. */
.ui-table-filter-popover {
z-index: 10;
z-index: var(--z-popover);
min-width: 12em;
padding: 0.5em;
background: var(--bg-elev);
border: 1px solid var(--border);
border-radius: 6px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
border-radius: var(--radius-md);
box-shadow: var(--shadow-pop);
}
.ui-table-filter-input {
width: 100%;
@ -138,7 +138,7 @@
background: var(--bg);
color: var(--fg);
border: 1px solid var(--border);
border-radius: 4px;
border-radius: var(--radius-sm);
padding: 0.25em 0.5em;
font: inherit;
font-size: 0.9em;

View file

@ -6,7 +6,7 @@
position: fixed;
top: 1em;
right: 1em;
z-index: 1100;
z-index: var(--z-toast);
display: flex;
flex-direction: column;
gap: 0.5em;
@ -19,7 +19,7 @@
background: var(--bg-elev);
border: 1px solid var(--border);
border-left-width: 3px;
border-radius: 0.4em;
border-radius: var(--radius-sm);
box-shadow: 0 4px 20px -6px var(--crust);
padding: 0.6em 0.9em;
font-size: 0.9em;