refactor(styles): improve light-mode contrast across surfaces and muted text

Dark mode unchanged. Targets that were reported as "barely visible" in
light theme:

Surfaces / dividers
- --color-border-subtle (light) bumped from rgb(0 0 0 / 0.05) to
  --neutral-300 (matches the Input underline variant's border color and
  yields a visible hairline on bg-surface / bg-paper).
- New bg-subtle utility (same color as border-subtle but as
  background-color) — used by Divider component and the TypographyMenu
  inline column separator. Replaces ad-hoc 'bg-black/5 dark:bg-white/10'
  and 'bg-black/10 dark:bg-white/10' bands.
- FontSearch + ComparisonView Search wrapper borders switched from
  hand-written 'border-swiss-black/5 dark:border-white/10' to
  border-subtle so they participate in the palette.

Muted text
- Button tertiary inactive text (light) bumped neutral-400 → neutral-600
  (~2.7:1 → ~7.5:1 contrast). Covers the A/B toggle and the font-list
  rows in the sidebar.
- Label/TechText muted variant (light) bumped neutral-400 → neutral-600.
  Covers the ComboControl value text.
- Link text aligned to neutral-500 / neutral-400 (subtle but visible).

No behavior changes; pure styling.
This commit is contained in:
Ilia Mashkov
2026-05-25 10:56:51 +03:00
parent 5b7ec03973
commit 8eee815e9a
8 changed files with 21 additions and 10 deletions
+8 -1
View File
@@ -16,7 +16,7 @@
/* Semantic mode-switching colors. These are redefined inside `.dark`
so utilities that reference them auto-adapt without a `dark:` variant. */
--color-border-subtle: rgb(0 0 0 / 0.05);
--color-border-subtle: var(--neutral-300);
--color-text-subtle: var(--neutral-500);
--color-skeleton: var(--neutral-200);
@@ -336,6 +336,13 @@
border-color: var(--color-border-subtle);
}
/* Same color as border-subtle, applied via background-color — for 1px
dividers, inline separator strips, and other hairlines that aren't
element borders. */
@utility bg-subtle {
background-color: var(--color-border-subtle);
}
/* Muted text color — paired with `border-subtle` naming. The previous
name `text-secondary` collided with Tailwind v4 auto-generating a
utility from `--color-secondary` (the shadcn near-white surface token
@@ -168,7 +168,7 @@ $effect(() => {
<!-- Controls with dividers between each -->
{#each typographySettingsStore.controls as control, i (control.id)}
{#if i > 0}
<div class="w-px h-6 md:h-8 bg-black/5 dark:bg-white/10 mx-0.5 md:mx-1 shrink-0"></div>
<div class="w-px h-6 md:h-8 bg-subtle mx-0.5 md:mx-1 shrink-0"></div>
{/if}
<ComboControl
+4 -2
View File
@@ -143,9 +143,11 @@ const variantStyles: Record<ButtonVariant, string> = {
tertiary: cn(
// Font override — must come after base in cn() to win via tailwind-merge
'font-secondary font-medium normal-case tracking-normal',
// Inactive state
// Inactive state — bumped in light mode for readable contrast against
// bg-surface (~7.5:1 vs. the prior ~2.7:1 with neutral-400). Dark
// unchanged because the existing tone reads well on dark-bg.
'bg-transparent',
'text-neutral-400 dark:text-neutral-400',
'text-neutral-600 dark:text-neutral-400',
'border border-transparent',
// Hover (inactive) — semi-transparent lift, no bg-paper token
'hover:bg-paper/50 dark:hover:bg-dark-card/50',
+1 -1
View File
@@ -25,7 +25,7 @@ let {
<div
class={cn(
'bg-black/10 dark:bg-white/10',
'bg-subtle',
orientation === 'horizontal' ? 'w-full h-px' : 'w-px h-full',
className,
)}
+3 -1
View File
@@ -25,7 +25,9 @@ export const labelSizeConfig: Record<LabelSize, string> = {
export const labelVariantConfig: Record<LabelVariant, string> = {
default: 'text-neutral-900 dark:text-neutral-100',
accent: 'text-brand',
muted: 'text-neutral-400 dark:text-neutral-500',
/* Light mode bumped from neutral-400 (~2.7:1 contrast, barely visible)
to neutral-600 (~7.5:1). Dark mode unchanged. */
muted: 'text-neutral-600 dark:text-neutral-500',
success: 'text-green-600 dark:text-green-400',
warning: 'text-yellow-600 dark:text-yellow-400',
error: 'text-brand',
+1 -1
View File
@@ -34,7 +34,7 @@ let {
<a
class={cn(
'group inline-flex items-center gap-1 text-2xs font-mono uppercase tracking-wider-mono',
'text-neutral-400 hover:text-brand transition-colors',
'text-neutral-500 dark:text-neutral-400 hover:text-brand transition-colors',
'bg-surface/80 dark:bg-dark-bg/80 backdrop-blur-sm px-2 py-1 pointer-events-auto',
className,
)}
@@ -9,7 +9,7 @@ import { appliedFilterStore } from '$features/FilterAndSortFonts';
import { SearchBar } from '$shared/ui';
</script>
<div class="p-6 border-b border-black/5">
<div class="p-6 border-b border-subtle">
<SearchBar
id="font-search"
class="w-full"
@@ -51,8 +51,8 @@ function toggleFilters() {
}
</script>
<div class="flex flex-col gap-3 border-b border-t border-swiss-black/5 dark:border-white/10">
<div class="relative w-full flex flex-col md:flex-row gap-y-4 border-b border-swiss-black/5 dark:border-white/10 py-4 md:py-6">
<div class="flex flex-col gap-3 border-b border-t border-subtle">
<div class="relative w-full flex flex-col md:flex-row gap-y-4 border-b border-subtle py-4 md:py-6">
<SearchBar
id="font-search"
class="w-full"