fix(ui): improve contrast across shared surfaces

This commit is contained in:
sam committed 2026-11-24 08:50:30 +11:00
1 parent d1e85c6e2a
commit afdb0a0c97
7 files changed
+14 -11

No files matched your search

+5 -2
View File
@@ -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
+2 -2
View File
@@ -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",
},
},
+2 -2
View File
@@ -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:
+1 -1
View File
@@ -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,
)
"
@@ -41,7 +41,7 @@ let highlighter: Promise<HighlighterCore> | 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
@@ -118,7 +118,7 @@ function open(row: Row): void {
<col v-for="column in shown" :key="column.id" :class="hidden(column)" :style="width(column)" />
<col v-if="trailing" class="w-12" />
</colgroup>
<TableHeader :class="stickyHeader && 'sticky top-0 z-10 bg-card shadow-[inset_0_-1px_0_var(--color-border)]'">
<TableHeader class="bg-muted" :class="stickyHeader && 'sticky top-0 z-10 shadow-[inset_0_-1px_0_var(--color-border)]'">
<TableRow>
<TableHead
v-for="column in shown"
+1 -1
View File
@@ -12,6 +12,6 @@ const props = defineProps<SkeletonProps>();
<template>
<div
data-slot="skeleton"
:class="cn('bg-muted rounded-md animate-pulse', props.class)"
:class="cn('rounded-md bg-border-strong motion-safe:animate-pulse', props.class)"
/>
</template>