From afdb0a0c979a693b79ee31330ad9df60382653d2 Mon Sep 17 00:00:00 2001 From: Sam Catlow Date: Tue, 24 Nov 2026 08:50:30 +1100 Subject: [PATCH] fix(ui): improve contrast across shared surfaces --- DESIGN.md | 7 +++++-- ui/src/components/ui/alert/index.ts | 4 ++-- ui/src/components/ui/button/index.ts | 4 ++-- ui/src/components/ui/card/Card.vue | 2 +- ui/src/components/ui/code-block/highlighter.ts | 4 ++-- ui/src/components/ui/data-table/DataTable.vue | 2 +- ui/src/components/ui/skeleton/Skeleton.vue | 2 +- 7 files changed, 14 insertions(+), 11 deletions(-) diff --git a/DESIGN.md b/DESIGN.md index 0d990d14c..a66f7af6b 100644 --- a/DESIGN.md +++ b/DESIGN.md @@ -351,10 +351,13 @@ Compact and contextual: small controls that appear where the work is. ### Cards / Containers - **Corner Style:** 12px. - **Background:** the card surface on the workspace. -- **Shadow Strategy:** none; a 1px foreground ring at 10% (see Elevation). +- **Edges:** a 1px border ring, without a shadow. - **Internal Padding:** 16px, or 12px for the small size. Section wraps a card with a title; an edited section shows a sage ring. -- **Data tables:** card surface and a quiet border, without card padding or a shadow. +- **Data tables:** card surface, muted header and a border, without card padding + or a shadow. +- **Alerts:** use the semantic soft fill and a matching border so they don't + look like regular cards. ### Inputs / Fields - **Style:** card background, 1px input stroke, 8px corners, 36px tall, label diff --git a/ui/src/components/ui/alert/index.ts b/ui/src/components/ui/alert/index.ts index 0f8d2aca1..96f7c4f34 100644 --- a/ui/src/components/ui/alert/index.ts +++ b/ui/src/components/ui/alert/index.ts @@ -10,9 +10,9 @@ export const alertVariants = cva( { variants: { variant: { - default: "bg-card text-card-foreground", + default: "border-info/40 bg-info-soft text-foreground *:[svg]:text-info", destructive: - "text-destructive bg-card *:data-[slot=alert-description]:text-destructive/90 *:[svg]:text-current", + "border-destructive/40 bg-destructive-soft text-destructive *:data-[slot=alert-description]:text-destructive *:[svg]:text-current", warn: "border-warn/40 bg-warn-soft *:[svg]:text-warn", }, }, diff --git a/ui/src/components/ui/button/index.ts b/ui/src/components/ui/button/index.ts index af015bb72..46f2da802 100644 --- a/ui/src/components/ui/button/index.ts +++ b/ui/src/components/ui/button/index.ts @@ -10,9 +10,9 @@ export const buttonVariants = cva( variant: { default: "bg-primary text-primary-foreground [a]:hover:bg-primary/80", outline: - "border-border bg-background hover:bg-muted hover:text-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 aria-expanded:bg-muted aria-expanded:text-foreground", + "border-border-strong bg-background hover:bg-muted hover:text-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 aria-expanded:bg-muted aria-expanded:text-foreground", secondary: - "bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground", + "border-border-strong bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground", ghost: "hover:bg-muted hover:text-foreground dark:hover:bg-muted/50 aria-expanded:bg-muted aria-expanded:text-foreground", destructive: diff --git a/ui/src/components/ui/card/Card.vue b/ui/src/components/ui/card/Card.vue index 1c2ff6799..f0451ff78 100644 --- a/ui/src/components/ui/card/Card.vue +++ b/ui/src/components/ui/card/Card.vue @@ -19,7 +19,7 @@ const props = withDefaults( :data-size="size" :class=" cn( - 'ring-foreground/10 bg-card text-card-foreground gap-4 overflow-hidden rounded-xl py-4 text-label ring-1 has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl group/card flex flex-col', + 'ring-border bg-card text-card-foreground gap-4 overflow-hidden rounded-xl py-4 text-label ring-1 has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl group/card flex flex-col', props.class, ) " diff --git a/ui/src/components/ui/code-block/highlighter.ts b/ui/src/components/ui/code-block/highlighter.ts index d08549308..b52177b38 100644 --- a/ui/src/components/ui/code-block/highlighter.ts +++ b/ui/src/components/ui/code-block/highlighter.ts @@ -41,7 +41,7 @@ let highlighter: Promise | undefined function getHighlighter() { highlighter ??= createHighlighterCore({ themes: [ - import('shiki/themes/github-light.mjs'), + import('shiki/themes/github-light-high-contrast.mjs'), import('shiki/themes/github-dark.mjs'), ], langs: [], @@ -83,7 +83,7 @@ export async function loadHighlighter(language: string) { const tokenize = (text: string) => shiki.codeToTokens(text, { lang, - themes: { light: 'github-light', dark: 'github-dark' }, + themes: { light: 'github-light-high-contrast', dark: 'github-dark' }, defaultColor: false, grammarState: state, }).tokens diff --git a/ui/src/components/ui/data-table/DataTable.vue b/ui/src/components/ui/data-table/DataTable.vue index ae3562bb3..46d7b6e41 100644 --- a/ui/src/components/ui/data-table/DataTable.vue +++ b/ui/src/components/ui/data-table/DataTable.vue @@ -118,7 +118,7 @@ function open(row: Row): void { - + ();