refactor styles

This commit is contained in:
2025-11-10 11:30:16 +01:00
parent b4a1821a55
commit 585caaee58
31 changed files with 4873 additions and 4867 deletions
+99
View File
@@ -0,0 +1,99 @@
button {
font: inherit;
border-radius: 2px;
border: 1px solid transparent;
padding: 0.35rem 0.85rem;
background: var(--accent);
color: var(--on-accent);
cursor: pointer;
font-weight: 500;
transition: background 0.15s ease, border-color 0.15s ease;
}
button[disabled] {
opacity: 0.55;
cursor: not-allowed;
}
a.button-link {
display: inline-flex;
align-items: center;
gap: 0.35rem;
font: inherit;
border-radius: 2px;
border: 1px solid transparent;
padding: 0.35rem 0.85rem;
background: var(--accent);
color: var(--on-accent);
text-decoration: none;
font-weight: 500;
transition: background 0.15s ease, border-color 0.15s ease;
}
a.button-link[aria-disabled='true'] {
opacity: 0.55;
}
a.button-link:hover:not([aria-disabled='true']) {
background: var(--accent-hover);
}
button.secondary {
background: transparent;
color: var(--fg);
border-color: var(--border);
}
button.secondary:hover:not([disabled]) {
background: var(--surface-subtle);
}
button.danger {
background: transparent;
color: var(--danger);
border-color: var(--danger-border);
}
button.danger:hover:not([disabled]) {
border-color: var(--danger);
background: var(--danger-subtle);
}
.icon-button {
display: inline-flex;
align-items: center;
justify-content: center;
border: none;
background: transparent;
color: var(--muted);
padding: 0.25rem;
border-radius: 4px;
cursor: pointer;
transition: background 0.15s ease, color 0.15s ease;
}
.icon-button:hover:not([disabled]) {
background: var(--sidebar-hover-bg);
color: var(--fg);
}
.icon-button.danger {
color: var(--danger);
}
.icon-button.danger:hover:not([disabled]) {
background: var(--danger-subtle);
}
.icon-button.ghost {
border: none;
background: transparent;
color: var(--muted);
padding: 0.2rem;
}
.icon-button.ghost:hover:not([disabled]) {
color: var(--danger);
background: transparent;
}
+56
View File
@@ -0,0 +1,56 @@
.with-icon {
display: inline-flex;
align-items: center;
gap: 0.35rem;
}
.icon-inline {
width: 1rem;
height: 1rem;
}
.icon {
width: 1rem;
height: 1rem;
display: inline-flex;
align-items: center;
justify-content: center;
}
@keyframes icon-spin {
to {
transform: rotate(360deg);
}
}
.icon--spin {
animation: icon-spin 0.9s linear infinite;
}
.icon--flip-y {
transform: scaleX(-1);
}
.visually-hidden {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
border: 0;
}
.icon path {
stroke: currentColor;
stroke-width: 1.6;
fill: none;
}
.icon--fill path {
stroke: none;
fill: currentColor;
}
+14
View File
@@ -0,0 +1,14 @@
.text-button {
background: none;
border: none;
color: var(--accent);
font-weight: 500;
font-size: 0.8rem;
cursor: pointer;
padding: 0.1rem 0.25rem;
}
.text-button:disabled {
opacity: 0.4;
cursor: not-allowed;
}
+295
View File
@@ -0,0 +1,295 @@
:root {
color-scheme: light dark;
--neutral-hue: 180deg;
--foreground-hue-offset: 10deg;
--accent-hue-offset: -20deg;
--dark-hue-offset: 30deg;
--dark-foreground-hue-offset: 10deg;
/* --- Neutrals --- */
--bg: oklch(0.97 0.001 var(--neutral-hue));
--surface: oklch(0.985 0.001 var(--neutral-hue));
--surface-subtle: oklch(0.96 0.002 var(--neutral-hue));
--fg: oklch(0.32 0.005 calc(var(--neutral-hue) + var(--foreground-hue-offset)));
--muted: oklch(0.54 0.008 calc(var(--neutral-hue) + var(--foreground-hue-offset)));
--sidebar-fg: oklch(0.56 0.007 calc(var(--neutral-hue) + var(--foreground-hue-offset)));
--border: oklch(0.92 0.002 calc(var(--neutral-hue) + var(--foreground-hue-offset)));
/* --- Accent (primary) --- */
--accent: oklch(0.61 0.2 calc(var(--neutral-hue) + var(--foreground-hue-offset) + var(--accent-hue-offset)));
--accent-hover: oklch(0.70 0.02 calc(var(--neutral-hue) + var(--foreground-hue-offset) + var(--accent-hue-offset)));
--on-accent: oklch(1 0 0);
--folder-icon-back: color-mix(in oklch, var(--accent) 78%, black 8%);
--folder-icon-mid: color-mix(in oklch, var(--accent) 60%, white 30%);
--folder-icon-front: color-mix(in oklch, var(--accent) 42%, white 58%);
--success-hue: 140deg;
--warning-hue: 85deg;
--danger-hue: 25deg;
--accent-soft: color-mix(in oklch, var(--accent) 12%, transparent);
--accent-elevated: color-mix(in oklch, var(--accent) 16%, transparent);
--accent-elevated-strong: color-mix(in oklch, var(--accent) 22%, transparent);
--accent-outline: color-mix(in oklch, var(--accent) 45%, transparent);
--accent-outline-strong: color-mix(in oklch, var(--accent) 90%, transparent);
--accent-focus: color-mix(in oklch, var(--accent) 85%, transparent);
--surface-overlay: color-mix(in oklch, white 82%, transparent);
/* -- Selection --- */
--selection: oklch(0.61 0.01 var(--neutral-hue));
/* --- Derived accent states --- */
--selection-soft: color-mix(in oklch, var(--selection) 12%, transparent);
/* --- Shadows & overlays --- */
--shadow-faint: color-mix(in oklch, black 6%, transparent);
--shadow-soft: color-mix(in oklch, black 12%, transparent);
--shadow-medium: color-mix(in oklch, black 18%, transparent);
--shadow-strong: color-mix(in oklch, black 28%, transparent);
--shadow-deep: color-mix(in oklch, black 55%, transparent);
--shadow-pop: color-mix(in oklch, black 25%, transparent);
--outline-subtle: color-mix(in oklch, black 6%, transparent);
--overlay-dark: color-mix(in oklch, black 55%, transparent);
--overlay-dim: color-mix(in oklch, oklch(0.28 0.01 calc(var(--neutral-hue) + var(--foreground-hue-offset) - 5deg)) 20%, transparent);
--overlay-darker: color-mix(in oklch, black 75%, transparent);
--surface-danger-subtle: color-mix(in oklch, var(--danger) 12%, transparent);
--overlay-accent-subtle: color-mix(in oklch, var(--accent) 12%, transparent);
--border-strong: color-mix(in oklch, var(--fg) 24%, transparent);
--surface-hover: color-mix(in oklch, white 10%, transparent);
--overlay-accent-strong: color-mix(in oklch, var(--accent) 24%, transparent);
--overlay-backdrop: color-mix(in oklch, oklch(0.22 0.015 calc(var(--neutral-hue) + var(--foreground-hue-offset) - 5deg)) 45%, transparent);
--overlay-shadow: color-mix(in oklch, oklch(0.22 0.015 calc(var(--neutral-hue) + var(--foreground-hue-offset) - 5deg)) 18%, transparent);
/* --- Semantic colors --- */
--success: oklch(0.68 0.16 var(--success-hue));
--warning: oklch(0.76 0.17 var(--warning-hue));
--danger: oklch(0.64 0.2 var(--danger-hue));
--success-subtle: color-mix(in oklch, var(--success) 12%, transparent);
--warning-subtle: color-mix(in oklch, var(--warning) 12%, transparent);
--danger-border: color-mix(in oklch, var(--danger) 45%, transparent);
--danger-soft: color-mix(in oklch, var(--danger) 12%, transparent);
--danger-subtle: color-mix(in oklch, var(--danger) 8%, transparent);
/* --- Explorer states --- */
--row-hover-bg: color-mix(in oklch, var(--selection) 6%, transparent);
--row-active-bg: color-mix(in oklch, var(--selection) 12%, transparent);
--sidebar-hover-bg: color-mix(in oklch, var(--selection) 8%, transparent);
--sidebar-active-bg: color-mix(in oklch, var(--selection) 16%, transparent);
--selection-ring: oklch(0.78 0.16 calc(var(--neutral-hue) + var(--foreground-hue-offset)));
--sidebar-active-pill-border: color-mix(in oklch, var(--accent) 64%, transparent);
--link: var(--accent);
--link-visited: color-mix(in oklch, var(--accent) 75%, var(--fg) 25%);
--preview-nav-bg: oklch(0.18 0.05 calc(var(--neutral-hue) + var(--foreground-hue-offset)));
--preview-nav-bg-hover: oklch(0.14 0.05 calc(var(--neutral-hue) + var(--foreground-hue-offset)));
--preview-nav-fg: var(--on-accent);
--text-on-dark: color-mix(in oklch, white 90%, transparent);
--surface-ink-soft: color-mix(in oklch, var(--fg) 8%, transparent);
font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
font-size: 15px;
--font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
--detail-panel-width: 30em;
--documents-grid-title-size: 0.8rem;
}
:root[data-theme='light'] {
color-scheme: light;
}
:root[data-theme='dark'] {
color-scheme: dark;
--dark-neutral-hue: calc(var(--neutral-hue) + var(--dark-hue-offset));
--dark-foreground-hue: calc(var(--neutral-hue) + var(--dark-foreground-hue-offset));
--bg: oklch(0.15 0.01 var(--dark-neutral-hue));
--surface: oklch(0.19 0.012 var(--dark-neutral-hue));
--surface-subtle: oklch(0.23 0.012 var(--dark-neutral-hue));
--fg: oklch(0.89 0.015 var(--dark-foreground-hue));
--muted: oklch(0.72 0.02 var(--dark-foreground-hue));
--sidebar-fg: oklch(0.78 0.02 var(--dark-foreground-hue));
--border: oklch(0.33 0.01 var(--dark-foreground-hue));
--accent: oklch(0.75 0.2 calc(var(--dark-foreground-hue) + var(--accent-hue-offset)));
--accent-hover: oklch(0.82 0.16 calc(var(--dark-foreground-hue) + var(--accent-hue-offset)));
--on-accent: oklch(0.15 0.015 var(--dark-foreground-hue));
--folder-icon-back: color-mix(in oklch, var(--accent) 72%, black 12%);
--folder-icon-mid: color-mix(in oklch, var(--accent) 50%, white 24%);
--folder-icon-front: color-mix(in oklch, var(--accent) 30%, white 50%);
--accent-soft: color-mix(in oklch, var(--accent) 22%, transparent);
--accent-elevated: color-mix(in oklch, var(--accent) 28%, transparent);
--accent-elevated-strong: color-mix(in oklch, var(--accent) 38%, transparent);
--accent-outline: color-mix(in oklch, var(--accent) 55%, transparent);
--accent-outline-strong: color-mix(in oklch, var(--accent) 90%, transparent);
--accent-focus: color-mix(in oklch, var(--accent) 80%, transparent);
--surface-overlay: color-mix(in oklch, black 60%, transparent);
--selection: oklch(0.44 0.04 220deg);
--selection-soft: color-mix(in oklch, var(--selection) 18%, transparent);
--shadow-faint: color-mix(in oklch, black 35%, transparent);
--shadow-soft: color-mix(in oklch, black 50%, transparent);
--shadow-medium: color-mix(in oklch, black 65%, transparent);
--shadow-strong: color-mix(in oklch, black 80%, transparent);
--shadow-deep: color-mix(in oklch, black 90%, transparent);
--shadow-pop: color-mix(in oklch, black 70%, transparent);
--outline-subtle: color-mix(in oklch, white 10%, transparent);
--overlay-dark: color-mix(in oklch, black 70%, transparent);
--overlay-dim: color-mix(in oklch, oklch(0.42 0.04 var(--dark-neutral-hue)) 35%, transparent);
--overlay-darker: color-mix(in oklch, black 85%, transparent);
--surface-danger-subtle: color-mix(in oklch, var(--danger) 26%, transparent);
--overlay-accent-subtle: color-mix(in oklch, var(--accent) 32%, transparent);
--border-strong: color-mix(in oklch, var(--fg) 30%, transparent);
--surface-hover: color-mix(in oklch, white 6%, transparent);
--overlay-accent-strong: color-mix(in oklch, var(--accent) 55%, transparent);
--overlay-backdrop: color-mix(in oklch, oklch(0.1 0.015 var(--dark-neutral-hue)) 70%, transparent);
--overlay-shadow: color-mix(in oklch, oklch(0.12 0.015 var(--dark-neutral-hue)) 55%, transparent);
--success: oklch(0.62 0.16 var(--success-hue));
--warning: oklch(0.68 0.17 var(--warning-hue));
--danger: oklch(0.60 0.2 var(--danger-hue));
--success-subtle: color-mix(in oklch, var(--success) 20%, transparent);
--warning-subtle: color-mix(in oklch, var(--warning) 20%, transparent);
--danger-border: color-mix(in oklch, var(--danger) 45%, transparent);
--danger-soft: color-mix(in oklch, var(--danger) 24%, transparent);
--danger-subtle: color-mix(in oklch, var(--danger) 18%, transparent);
--row-hover-bg: color-mix(in oklch, white 4%, transparent);
--row-active-bg: color-mix(in oklch, var(--selection) 20%, transparent);
--sidebar-hover-bg: color-mix(in oklch, white 6%, transparent);
--sidebar-active-bg: color-mix(in oklch, var(--selection) 26%, transparent);
--selection-ring: oklch(0.68 0.16 var(--dark-foreground-hue));
--sidebar-active-pill-border: color-mix(in oklch, var(--accent) 72%, transparent);
--link: color-mix(in oklch, var(--accent) 92%, transparent);
--link-visited: color-mix(in oklch, var(--accent) 70%, white 20%);
--preview-nav-bg: oklch(0.3 0.04 var(--dark-neutral-hue));
--preview-nav-bg-hover: oklch(0.35 0.04 var(--dark-neutral-hue));
--preview-nav-fg: var(--fg);
--text-on-dark: color-mix(in oklch, white 92%, transparent);
--surface-ink-soft: color-mix(in oklch, white 12%, transparent);
}
@media (prefers-color-scheme: dark) {
:root:not([data-theme='light']) {
color-scheme: dark;
--dark-neutral-hue: calc(var(--neutral-hue) + var(--dark-hue-offset));
--dark-foreground-hue: calc(var(--neutral-hue) + var(--dark-foreground-hue-offset));
--bg: oklch(0.15 0.01 var(--dark-neutral-hue));
--surface: oklch(0.19 0.012 var(--dark-neutral-hue));
--surface-subtle: oklch(0.23 0.012 var(--dark-neutral-hue));
--fg: oklch(0.89 0.015 var(--dark-foreground-hue));
--muted: oklch(0.72 0.02 var(--dark-foreground-hue));
--sidebar-fg: oklch(0.78 0.02 var(--dark-foreground-hue));
--border: oklch(0.33 0.01 var(--dark-foreground-hue));
--accent: oklch(0.75 0.2 calc(var(--dark-foreground-hue) + var(--accent-hue-offset)));
--accent-hover: oklch(0.82 0.16 calc(var(--dark-foreground-hue) + var(--accent-hue-offset)));
--on-accent: oklch(0.15 0.015 var(--dark-foreground-hue));
--folder-icon-back: color-mix(in oklch, var(--accent) 72%, black 12%);
--folder-icon-mid: color-mix(in oklch, var(--accent) 50%, white 24%);
--folder-icon-front: color-mix(in oklch, var(--accent) 30%, white 50%);
--accent-soft: color-mix(in oklch, var(--accent) 22%, transparent);
--accent-elevated: color-mix(in oklch, var(--accent) 28%, transparent);
--accent-elevated-strong: color-mix(in oklch, var(--accent) 38%, transparent);
--accent-outline: color-mix(in oklch, var(--accent) 55%, transparent);
--accent-outline-strong: color-mix(in oklch, var(--accent) 90%, transparent);
--accent-focus: color-mix(in oklch, var(--accent) 80%, transparent);
--surface-overlay: color-mix(in oklch, black 60%, transparent);
--selection: oklch(0.44 0.04 220deg);
--selection-soft: color-mix(in oklch, var(--selection) 18%, transparent);
--shadow-faint: color-mix(in oklch, black 35%, transparent);
--shadow-soft: color-mix(in oklch, black 50%, transparent);
--shadow-medium: color-mix(in oklch, black 65%, transparent);
--shadow-strong: color-mix(in oklch, black 80%, transparent);
--shadow-deep: color-mix(in oklch, black 90%, transparent);
--shadow-pop: color-mix(in oklch, black 70%, transparent);
--outline-subtle: color-mix(in oklch, white 10%, transparent);
--overlay-dark: color-mix(in oklch, black 70%, transparent);
--overlay-dim: color-mix(in oklch, oklch(0.42 0.04 var(--dark-neutral-hue)) 35%, transparent);
--overlay-darker: color-mix(in oklch, black 85%, transparent);
--surface-danger-subtle: color-mix(in oklch, var(--danger) 26%, transparent);
--overlay-accent-subtle: color-mix(in oklch, var(--accent) 32%, transparent);
--border-strong: color-mix(in oklch, var(--fg) 30%, transparent);
--surface-hover: color-mix(in oklch, white 6%, transparent);
--overlay-accent-strong: color-mix(in oklch, var(--accent) 55%, transparent);
--overlay-backdrop: color-mix(in oklch, oklch(0.1 0.015 var(--dark-neutral-hue)) 70%, transparent);
--overlay-shadow: color-mix(in oklch, oklch(0.12 0.015 var(--dark-neutral-hue)) 55%, transparent);
--success: oklch(0.62 0.16 var(--success-hue));
--warning: oklch(0.68 0.17 var(--warning-hue));
--danger: oklch(0.60 0.2 var(--danger-hue));
--success-subtle: color-mix(in oklch, var(--success) 20%, transparent);
--warning-subtle: color-mix(in oklch, var(--warning) 20%, transparent);
--danger-border: color-mix(in oklch, var(--danger) 45%, transparent);
--danger-soft: color-mix(in oklch, var(--danger) 24%, transparent);
--danger-subtle: color-mix(in oklch, var(--danger) 18%, transparent);
--row-hover-bg: color-mix(in oklch, white 4%, transparent);
--row-active-bg: color-mix(in oklch, var(--selection) 20%, transparent);
--sidebar-hover-bg: color-mix(in oklch, white 6%, transparent);
--sidebar-active-bg: color-mix(in oklch, var(--selection) 26%, transparent);
--selection-ring: oklch(0.68 0.16 var(--dark-foreground-hue));
--sidebar-active-pill-border: color-mix(in oklch, var(--accent) 72%, transparent);
--link: color-mix(in oklch, var(--accent) 92%, transparent);
--link-visited: color-mix(in oklch, var(--accent) 70%, white 20%);
--preview-nav-bg: oklch(0.3 0.04 var(--dark-neutral-hue));
--preview-nav-bg-hover: oklch(0.35 0.04 var(--dark-neutral-hue));
--preview-nav-fg: var(--fg);
--text-on-dark: color-mix(in oklch, white 92%, transparent);
--surface-ink-soft: color-mix(in oklch, white 12%, transparent);
}
}
html,
body {
height: 100%;
}
body {
margin: 0;
background: var(--bg);
color: var(--fg);
overflow: hidden;
}
body.has-main-content {
background: var(--surface);
}
a {
color: var(--accent);
text-decoration: underline;
text-decoration-thickness: 1px;
text-underline-offset: 0.18em;
transition: color 0.15s ease, text-decoration-color 0.15s ease;
}
a:visited {
color: var(--link-visited);
}
a:hover,
a:focus-visible {
color: var(--accent-hover);
outline: none;
text-decoration-color: currentColor;
}
#app {
height: 100%;
}