Files
Docwell/Packages/ui/src/theme.css
T
tajniak81andClaude Opus 5.5 ba394b8fac Finish Phase 0: lint, codegen, contributor docs and the two remaining spikes
Repository basics:
- CONTRIBUTING.md and CODE_OF_CONDUCT.md (Contributor Covenant 2.1)
- SPDX AGPL-3.0-or-later headers on all hand-written sources, checked in CI
- golangci-lint (shared .golangci.yml), ESLint and Prettier, all run in CI

API codegen from api/openapi.yaml (npm run generate, drift fails CI):
- Go types via oapi-codegen in Server/internal/api
- a contract test that the router and the spec list the same routes
- Dart models via Phone-App/tool/generate_api.dart; the app uses them

Spike: shared Tiptap editor in a Flutter WebView (ADR-4)
- @docwell/editor-bridge builds the editor into one HTML page with a
  versioned JSON protocol; Phone-App hosts it with webview_flutter and a
  native toolbar. Integration test passes on an Android API 35 emulator.
- flutter_inappwebview dropped: its Android plugin fails on AGP 9.

Spike: Wails v3 desktop (ADR-11)
- system tray, docwell:// deep links (page and space only) with
  single-instance hand-off, and the built-in updater with a required
  ed25519 signing key. Verified on Windows.
- regenerated build assets register the scheme and drop template
  placeholders.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 16:11:07 +01:00

243 lines
7.3 KiB
CSS

/* SPDX-License-Identifier: AGPL-3.0-or-later */
/* Docwell design system for Tailwind CSS v4: the tokens from
Design/docwell-all/3-design-system/source/tokens.json, plus the component
classes. Import after `@import "tailwindcss";` in each app's main stylesheet.
Keep this file in sync with that tokens.json. */
/* Fonts are bundled (no third-party requests): Docwell is self-hosted and
the desktop app works offline. All three are SIL Open Font License. */
@import "@fontsource-variable/inter/wght.css";
@import "@fontsource-variable/source-serif-4/opsz.css";
@import "@fontsource-variable/jetbrains-mono/wght.css";
@source "./";
@custom-variant dark (&:where(.dark, .dark *));
@theme {
--font-sans: "Inter Variable", "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
--font-serif: "Source Serif 4 Variable", "Source Serif 4", "Iowan Old Style", Georgia, serif;
--font-mono: "JetBrains Mono Variable", "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
/* Colors: utilities like bg-surface-sunken, text-ink-muted, border-line. */
--color-surface: var(--dw-surface);
--color-surface-sunken: var(--dw-surface-sunken);
--color-surface-raised: var(--dw-surface-raised);
--color-surface-hover: var(--dw-surface-hover);
--color-line: var(--dw-line);
--color-line-strong: var(--dw-line-strong);
--color-ink: var(--dw-ink);
--color-ink-muted: var(--dw-ink-muted);
--color-ink-faint: var(--dw-ink-faint);
--color-well: #12403c;
--color-spring: var(--dw-spring);
--color-primary: var(--dw-primary);
--color-primary-hover: var(--dw-primary-hover);
--color-on-primary: var(--dw-on-primary);
--color-accent: var(--dw-accent);
--color-accent-soft: var(--dw-accent-soft);
--color-selection: var(--dw-selection);
--color-focus-ring: var(--dw-focus-ring);
--color-success: var(--dw-success);
--color-success-soft: var(--dw-success-soft);
--color-warning: var(--dw-warning);
--color-warning-soft: var(--dw-warning-soft);
--color-danger: var(--dw-danger);
--color-danger-soft: var(--dw-danger-soft);
--color-on-danger: var(--dw-on-danger);
--color-info: var(--dw-info);
--color-info-soft: var(--dw-info-soft);
--color-code-bg: var(--dw-code-bg);
/* Interface text styles: text-ui-xs … text-ui-lg. */
--text-ui-xs: 12px;
--text-ui-xs--line-height: 16px;
--text-ui-xs--letter-spacing: 0.01em;
--text-ui-xs--font-weight: 500;
--text-ui-sm: 13px;
--text-ui-sm--line-height: 18px;
--text-ui-md: 14px;
--text-ui-md--line-height: 20px;
--text-ui-lg: 16px;
--text-ui-lg--line-height: 24px;
--text-ui-lg--font-weight: 600;
/* Document text styles: text-doc-title … text-doc-caption. */
--text-doc-title: 40px;
--text-doc-title--line-height: 48px;
--text-doc-title--letter-spacing: -0.01em;
--text-doc-title--font-weight: 600;
--text-doc-h1: 30px;
--text-doc-h1--line-height: 38px;
--text-doc-h1--font-weight: 600;
--text-doc-h2: 24px;
--text-doc-h2--line-height: 32px;
--text-doc-h2--font-weight: 600;
--text-doc-h3: 18px;
--text-doc-h3--line-height: 28px;
--text-doc-h3--font-weight: 600;
--text-doc-body: 16px;
--text-doc-body--line-height: 27px;
--text-doc-body-serif: 18px;
--text-doc-body-serif--line-height: 30px;
--text-doc-caption: 13px;
--text-doc-caption--line-height: 20px;
--text-code: 14px;
--text-code--line-height: 22px;
/* Radii: rounded-xs (badges) · sm (buttons, inputs, rows) · md (cards, menus) · lg (dialogs). */
--radius-xs: 4px;
--radius-sm: 6px;
--radius-md: 10px;
--radius-lg: 16px;
/* Floating layers only; everything else is separated by borders. */
--shadow-menu: var(--dw-shadow-menu);
--shadow-dialog: var(--dw-shadow-dialog);
/* Sizes: max-w-doc, w-sidebar, h-control-md … (spacing is Tailwind's 4px scale). */
--container-doc: 720px;
--container-doc-wide: 1040px;
--spacing-sidebar: 264px;
--spacing-control-sm: 28px;
--spacing-control-md: 34px;
}
:root {
--dw-surface: #ffffff;
--dw-surface-sunken: #f4f7f6;
--dw-surface-raised: #ffffff;
--dw-surface-hover: #e9efed;
--dw-line: #dce4e1;
--dw-line-strong: #7f918c;
--dw-ink: #13201e;
--dw-ink-muted: #55645f;
--dw-ink-faint: #677672;
--dw-spring: #16a37c;
--dw-primary: #12403c;
--dw-primary-hover: #1b5853;
--dw-on-primary: #ffffff;
--dw-accent: #0e7a5c;
--dw-accent-soft: #e1f3ec;
--dw-selection: #c4eadb;
--dw-focus-ring: #0e8a68;
--dw-success: #1d6f47;
--dw-success-soft: #e2f3e8;
--dw-warning: #7f5300;
--dw-warning-soft: #fdf2dc;
--dw-danger: #b0302a;
--dw-danger-soft: #fbe8e6;
--dw-on-danger: #ffffff;
--dw-info: #2c5aa8;
--dw-info-soft: #e7eefb;
--dw-code-bg: #f1f5f4;
--dw-shadow-menu: 0 1px 2px rgba(11, 42, 39, 0.06), 0 8px 24px rgba(11, 42, 39, 0.12);
--dw-shadow-dialog: 0 2px 6px rgba(11, 42, 39, 0.08), 0 24px 64px rgba(11, 42, 39, 0.18);
color-scheme: light;
}
/* Dark is a full theme, not an inversion. */
.dark {
--dw-surface: #0f1716;
--dw-surface-sunken: #0b1211;
--dw-surface-raised: #18221f;
--dw-surface-hover: #202c29;
--dw-line: #2a3735;
--dw-line-strong: #5d706b;
--dw-ink: #e8efed;
--dw-ink-muted: #a3b3ae;
--dw-ink-faint: #8a9b96;
--dw-spring: #2bc495;
--dw-primary: #2bc495;
--dw-primary-hover: #4fd3aa;
--dw-on-primary: #06291f;
--dw-accent: #5fd8b1;
--dw-accent-soft: #14332d;
--dw-selection: #1f4d43;
--dw-focus-ring: #5fd8b1;
--dw-success: #6fd39c;
--dw-success-soft: #11301f;
--dw-warning: #f2bc55;
--dw-warning-soft: #33260a;
--dw-danger: #ff9289;
--dw-danger-soft: #3a1614;
--dw-on-danger: #2a0807;
--dw-info: #93b8ff;
--dw-info-soft: #162440;
--dw-code-bg: #141e1c;
--dw-shadow-menu: 0 1px 2px rgba(0, 0, 0, 0.5), 0 8px 24px rgba(0, 0, 0, 0.55);
--dw-shadow-dialog: 0 2px 6px rgba(0, 0, 0, 0.5), 0 24px 64px rgba(0, 0, 0, 0.6);
color-scheme: dark;
}
html {
@apply bg-surface;
}
body {
@apply bg-surface text-ui-md text-ink font-sans antialiased;
}
::selection {
@apply bg-selection;
}
/* Keyboard focus: 2px focus-ring outline, 2px offset, on every interactive element. */
:where(
a,
button,
[role="button"],
[role="treeitem"],
summary,
select,
input[type="checkbox"],
input[type="radio"]
):focus-visible {
outline: 2px solid var(--dw-focus-ring);
outline-offset: 2px;
}
/* Text inputs draw focus at 0 offset and turn their border focus-ring. */
:where(input:not([type="checkbox"], [type="radio"]), textarea, select).dw-input:focus-visible {
outline: 2px solid var(--dw-focus-ring);
outline-offset: 0;
border-color: var(--dw-focus-ring);
}
@layer components {
/* Inputs and selects (the TextField look), for places that use a bare control. */
.dw-input {
@apply h-control-md min-w-0 rounded-sm border border-line-strong bg-surface px-3 text-ui-md text-ink placeholder:text-ink-faint;
}
textarea.dw-input {
@apply h-auto py-2;
}
.dw-input[aria-invalid="true"] {
@apply border-danger;
}
/* Cards: separated by a line, never a shadow. */
.dw-card {
@apply rounded-md border border-line bg-surface-raised p-6;
}
/* Uppercase section labels (sidebar groups, settings sections). */
.dw-label {
@apply text-ui-xs uppercase text-ink-muted;
}
.dw-link {
@apply text-accent underline-offset-2 hover:underline;
}
}
@media (prefers-reduced-motion: reduce) {
*,
*::before,
*::after {
transition: none !important;
animation: none !important;
}
}