Add styles with light and dark themes
This commit is contained in:
1 parent
b848c1c8ff
commit
353ebeb76a
1 file changed
+167
@@ -0,0 +1,167 @@
|
|||||||
|
/* Colors are variables so the theme can follow the phone (prefers-color-scheme) or a manual choice (data-theme). */
|
||||||
|
:root {
|
||||||
|
color-scheme: light;
|
||||||
|
--bg: #f6f7f9;
|
||||||
|
--surface: #ffffff;
|
||||||
|
--surface-2: #eef1f5;
|
||||||
|
--text: #1c1f24;
|
||||||
|
--muted: #5d6877;
|
||||||
|
--border: #d9dee5;
|
||||||
|
--accent: #2563eb;
|
||||||
|
--accent-soft: #dbe6ff;
|
||||||
|
--on-accent: #ffffff;
|
||||||
|
--warn: #9a5800;
|
||||||
|
--warn-soft: #fff1dc;
|
||||||
|
--danger: #c62828;
|
||||||
|
--danger-soft: #fde7e7;
|
||||||
|
--ok: #1b7f3b;
|
||||||
|
--ok-soft: #e1f5e7;
|
||||||
|
--grey-day: #eceef2;
|
||||||
|
--highlight: rgba(37, 99, 235, 0.22);
|
||||||
|
--shadow: 0 1px 3px rgba(16, 24, 40, 0.08);
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (prefers-color-scheme: dark) {
|
||||||
|
:root:not([data-theme='light']) {
|
||||||
|
color-scheme: dark;
|
||||||
|
--bg: #14171c;
|
||||||
|
--surface: #1d2128;
|
||||||
|
--surface-2: #262b34;
|
||||||
|
--text: #e8ebf0;
|
||||||
|
--muted: #9aa4b2;
|
||||||
|
--border: #353b46;
|
||||||
|
--accent: #6b9bff;
|
||||||
|
--accent-soft: #233456;
|
||||||
|
--on-accent: #0d1424;
|
||||||
|
--warn: #f0b45c;
|
||||||
|
--warn-soft: #3a2c15;
|
||||||
|
--danger: #ff8a80;
|
||||||
|
--danger-soft: #3d2020;
|
||||||
|
--ok: #7fd49a;
|
||||||
|
--ok-soft: #1d3527;
|
||||||
|
--grey-day: #22262e;
|
||||||
|
--highlight: rgba(107, 155, 255, 0.3);
|
||||||
|
--shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
:root[data-theme='dark'] {
|
||||||
|
color-scheme: dark;
|
||||||
|
--bg: #14171c;
|
||||||
|
--surface: #1d2128;
|
||||||
|
--surface-2: #262b34;
|
||||||
|
--text: #e8ebf0;
|
||||||
|
--muted: #9aa4b2;
|
||||||
|
--border: #353b46;
|
||||||
|
--accent: #6b9bff;
|
||||||
|
--accent-soft: #233456;
|
||||||
|
--on-accent: #0d1424;
|
||||||
|
--warn: #f0b45c;
|
||||||
|
--warn-soft: #3a2c15;
|
||||||
|
--danger: #ff8a80;
|
||||||
|
--danger-soft: #3d2020;
|
||||||
|
--ok: #7fd49a;
|
||||||
|
--ok-soft: #1d3527;
|
||||||
|
--grey-day: #22262e;
|
||||||
|
--highlight: rgba(107, 155, 255, 0.3);
|
||||||
|
--shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
|
||||||
|
}
|
||||||
|
|
||||||
|
* { box-sizing: border-box; }
|
||||||
|
|
||||||
|
html, body {
|
||||||
|
margin: 0;
|
||||||
|
background: var(--bg);
|
||||||
|
color: var(--text);
|
||||||
|
font: 16px/1.45 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
|
||||||
|
-webkit-text-size-adjust: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
main {
|
||||||
|
max-width: 1100px;
|
||||||
|
margin: 0 auto;
|
||||||
|
padding: 16px 16px calc(88px + env(safe-area-inset-bottom));
|
||||||
|
}
|
||||||
|
|
||||||
|
h1 { font-size: 1.5rem; margin: 4px 0 16px; }
|
||||||
|
h2 { font-size: 1.15rem; margin: 24px 0 8px; }
|
||||||
|
h3 { font-size: 1rem; margin: 16px 0 8px; }
|
||||||
|
a { color: var(--accent); }
|
||||||
|
p { margin: 8px 0; }
|
||||||
|
.muted { color: var(--muted); }
|
||||||
|
.small { font-size: 0.875rem; }
|
||||||
|
|
||||||
|
.card {
|
||||||
|
background: var(--surface);
|
||||||
|
border: 1px solid var(--border);
|
||||||
|
border-radius: 12px;
|
||||||
|
padding: 12px 16px;
|
||||||
|
box-shadow: var(--shadow);
|
||||||
|
}
|
||||||
|
.stack > * + * { margin-top: 12px; }
|
||||||
|
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
|
||||||
|
.spread { justify-content: space-between; }
|
||||||
|
.grow { flex: 1; }
|
||||||
|
|
||||||
|
/* Touch targets are at least 44px. */
|
||||||
|
button, .button, select, input, textarea {
|
||||||
|
font: inherit;
|
||||||
|
color: inherit;
|
||||||
|
min-height: 44px;
|
||||||
|
border-radius: 10px;
|
||||||
|
}
|
||||||
|
button, .button {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
gap: 6px;
|
||||||
|
padding: 0 16px;
|
||||||
|
border: 1px solid var(--border);
|
||||||
|
background: var(--surface);
|
||||||
|
cursor: pointer;
|
||||||
|
text-decoration: none;
|
||||||
|
color: var(--text);
|
||||||
|
}
|
||||||
|
button:disabled { opacity: 0.5; cursor: default; }
|
||||||
|
button.primary, .button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
|
||||||
|
button.danger { color: var(--danger); border-color: var(--danger); }
|
||||||
|
button.quiet { border-color: transparent; background: transparent; }
|
||||||
|
button.small { min-height: 36px; padding: 0 10px; font-size: 0.875rem; }
|
||||||
|
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
|
||||||
|
outline: 3px solid var(--accent);
|
||||||
|
outline-offset: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
input, select, textarea {
|
||||||
|
width: 100%;
|
||||||
|
padding: 8px 10px;
|
||||||
|
border: 1px solid var(--border);
|
||||||
|
background: var(--surface);
|
||||||
|
}
|
||||||
|
input[type='checkbox'], input[type='radio'] { width: 22px; min-height: 22px; height: 22px; accent-color: var(--accent); }
|
||||||
|
input[type='color'] { padding: 2px; width: 56px; }
|
||||||
|
textarea { min-height: 88px; }
|
||||||
|
label { display: block; font-size: 0.875rem; color: var(--muted); margin-bottom: 4px; }
|
||||||
|
label.check { display: flex; align-items: center; gap: 10px; color: var(--text); font-size: 1rem; min-height: 44px; margin: 0; }
|
||||||
|
.field { margin-bottom: 12px; }
|
||||||
|
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0 12px; }
|
||||||
|
|
||||||
|
.badge {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 4px;
|
||||||
|
padding: 2px 8px;
|
||||||
|
border-radius: 999px;
|
||||||
|
font-size: 0.8rem;
|
||||||
|
font-weight: 600;
|
||||||
|
background: var(--surface-2);
|
||||||
|
color: var(--muted);
|
||||||
|
}
|
||||||
|
.badge.warn { background: var(--warn-soft); color: var(--warn); }
|
||||||
|
.badge.ok { background: var(--ok-soft); color: var(--ok); }
|
||||||
|
.badge.danger { background: var(--danger-soft); color: var(--danger); }
|
||||||
|
.badge.info { background: var(--accent-soft); color: var(--accent); }
|
||||||
|
|
||||||
|
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
|
||||||
|
.empty { text-align: center; padding: 32px 16px; color: var(--muted); }
|
||||||
|
.error { background: var(--danger-soft); color: var(--danger); padding: 10px 14px; border-radius: 10px; }
|
||||||
Reference in new issue
Block a user