Files
pardis/src/app.css
2026-09-06 13:50:58 +02:00

239 lines
4.3 KiB
CSS

/*
* Design tokens for outdoor use.
*
* Rules this file follows, deliberately:
* - Primary text is pure black on pure white (21:1). No grey body copy anywhere.
* - Theme is an explicit setting, never `prefers-color-scheme`: that follows the
* OS, and a dark UI is *harder* to read in direct sunlight, not easier.
* - Nothing tappable is under 64px; primary actions are 88px.
*/
:root {
--bg: #ffffff;
--fg: #000000;
--fg-dim: #333333; /* 12.6:1 — the darkest "secondary" we allow */
--surface: #f0f0f0;
--line: #000000;
--accent: #0047b3; /* 8.2:1 against white, and against its own white text */
--accent-fg: #ffffff;
--accent-soft: #dce7fb;
--ok: #0f5c2e;
--warn: #8a3d00;
--danger: #a3001b;
--danger-fg: #ffffff;
--tap: 64px;
--tap-lg: 88px;
--gap: 12px;
--pad: 16px;
--radius: 10px;
--border: 3px;
--sans: system-ui, 'Segoe UI', Roboto, sans-serif;
font-family: var(--sans);
font-size: 20px;
line-height: 1.35;
color: var(--fg);
background: var(--bg);
-webkit-text-size-adjust: 100%;
-webkit-tap-highlight-color: transparent;
}
:root[data-theme='nuit'] {
--bg: #000000;
--fg: #ffffff;
--fg-dim: #cccccc;
--surface: #1a1a1a;
--line: #ffffff;
--accent: #ffb000; /* amber reads well at night and preserves dark adaptation */
--accent-fg: #000000;
--accent-soft: #3a2a00;
--ok: #5ce08a;
--warn: #ffb000;
--danger: #ff5c72;
--danger-fg: #000000;
}
* {
box-sizing: border-box;
}
html,
body {
margin: 0;
min-height: 100%;
background: var(--bg);
color: var(--fg);
}
body {
/* Fill the notch area with the app background in a standalone PWA. */
padding: env(safe-area-inset-top) env(safe-area-inset-right)
env(safe-area-inset-bottom) env(safe-area-inset-left);
overscroll-behavior-y: contain;
}
#app {
max-width: 640px;
margin: 0 auto;
min-height: 100svh;
display: flex;
flex-direction: column;
}
h1,
h2,
h3 {
margin: 0;
font-weight: 800;
letter-spacing: -0.01em;
}
h1 {
font-size: 1.6rem;
}
h2 {
font-size: 1.25rem;
}
h3 {
font-size: 1.05rem;
}
p {
margin: 0;
}
/* Times and durations must never reflow as digits change. */
.tnum {
font-variant-numeric: tabular-nums;
font-feature-settings: 'tnum';
}
.dim {
color: var(--fg-dim);
}
.center {
text-align: center;
}
/* ------------------------------------------------------------------ controls */
button {
font: inherit;
font-weight: 700;
color: var(--fg);
background: var(--bg);
border: var(--border) solid var(--line);
border-radius: var(--radius);
min-height: var(--tap);
padding: 0 var(--pad);
cursor: pointer;
touch-action: manipulation;
display: inline-flex;
align-items: center;
justify-content: center;
gap: 10px;
}
button:active {
transform: translateY(2px);
}
button:focus-visible {
outline: 4px solid var(--accent);
outline-offset: 3px;
}
button[disabled] {
opacity: 0.4;
cursor: default;
}
.btn-primary {
min-height: var(--tap-lg);
font-size: 1.2rem;
color: var(--accent-fg);
background: var(--accent);
border-color: var(--accent);
width: 100%;
}
.btn-danger {
color: var(--danger-fg);
background: var(--danger);
border-color: var(--danger);
}
.btn-row {
display: flex;
gap: var(--gap);
}
.btn-row > * {
flex: 1;
}
input[type='text'],
input[type='time'],
input[type='number'],
select {
font: inherit;
font-weight: 600;
color: var(--fg);
background: var(--bg);
border: var(--border) solid var(--line);
border-radius: var(--radius);
min-height: var(--tap);
padding: 0 12px;
width: 100%;
}
input:focus-visible,
select:focus-visible {
outline: 4px solid var(--accent);
outline-offset: 2px;
}
/* -------------------------------------------------------------------- layout */
.screen {
flex: 1;
display: flex;
flex-direction: column;
gap: var(--gap);
padding: var(--pad);
padding-bottom: 96px; /* clear of the fixed nav */
}
.card {
border: var(--border) solid var(--line);
border-radius: var(--radius);
padding: var(--pad);
background: var(--bg);
}
.card-accent {
background: var(--accent-soft);
}
.stack {
display: flex;
flex-direction: column;
gap: var(--gap);
}
.row-between {
display: flex;
align-items: baseline;
justify-content: space-between;
gap: var(--gap);
}
hr {
border: 0;
border-top: var(--border) solid var(--line);
margin: 4px 0;
}