From 081baf15eec4af24c0409c1baa64677635727b5b Mon Sep 17 00:00:00 2001 From: DanielS Date: Fri, 3 Jul 2026 00:22:10 +0200 Subject: [PATCH] style: improve accessibility contrast and set default theme to dark --- shop/app/globals.css | 111 +++++++++++++++++++++++++++++-------------- shop/app/layout.tsx | 4 +- 2 files changed, 77 insertions(+), 38 deletions(-) diff --git a/shop/app/globals.css b/shop/app/globals.css index 83ae263..45bfc36 100644 --- a/shop/app/globals.css +++ b/shop/app/globals.css @@ -4,48 +4,82 @@ @layer base { :root { - --background: 220 33% 98%; - --foreground: 220 40% 2%; + /* Light Mode: Maximierter Kontrast (Reines Weißer Hintergrund + Tiefschwarzer Text) */ + --background: 0 0% 100%; + --foreground: 224 71% 4%; --card: 0 0% 100%; - --card-foreground: 220 40% 2%; + --card-foreground: 224 71% 4%; --popover: 0 0% 100%; - --popover-foreground: 220 40% 2%; - --primary: 199 100% 43%; + --popover-foreground: 224 71% 4%; + + /* Primary: Cyan/Blau lesbarer gemacht */ + --primary: 199 100% 35%; --primary-foreground: 0 0% 100%; + + /* Muted & Accent: Deutlich dunklerer Text für Barrierefreiheit */ --secondary: 220 14% 90%; - --secondary-foreground: 220 40% 2%; - --muted: 220 14% 90%; - --muted-foreground: 220 14% 40%; + --secondary-foreground: 224 71% 4%; + --muted: 220 14% 92%; + --muted-foreground: 220 20% 28%; + /* Vorher 40% Helligkeit, jetzt 28% (viel dunkler) */ --accent: 220 14% 90%; - --accent-foreground: 220 40% 2%; - --destructive: 0 84% 60%; + --accent-foreground: 224 71% 4%; + + --destructive: 0 84% 50%; --destructive-foreground: 0 0% 100%; - --border: 220 14% 85%; - --input: 220 14% 85%; - --ring: 220 90% 56%; + --border: 220 14% 75%; + /* Grenzen sichtbarer gemacht */ + --input: 220 14% 75%; + --ring: 199 100% 35%; --radius: 0.75rem; } .dark { - --background: 224 71% 4%; - --foreground: 213 31% 91%; - --card: 224 71% 4%; - --card-foreground: 213 31% 91%; - --popover: 224 71% 4%; - --popover-foreground: 213 31% 91%; - --primary: 210 40% 98%; - --primary-foreground: 222.2 47.4% 1.2%; - --secondary: 222.2 47.4% 11.2%; - --secondary-foreground: 210 40% 98%; - --muted: 222.2 47.4% 11.2%; - --muted-foreground: 215.4 16.3% 56.9%; - --accent: 222.2 47.4% 11.2%; - --accent-foreground: 210 40% 98%; - --destructive: 0 63% 31%; - --destructive-foreground: 210 40% 98%; - --border: 222.2 47.4% 11.2%; - --input: 222.2 47.4% 11.2%; - --ring: 212.7 26.8% 83.9%; + /* Dark Mode: Reines Tiefschwarz erhöht den Kontrast zu weißem Text drastisch */ + --background: 240 10% 3.9%; + --foreground: 0 0% 98%; + --card: 240 10% 3.9%; + --card-foreground: 0 0% 98%; + --popover: 240 10% 3.9%; + --popover-foreground: 0 0% 98%; + + --primary: 0 0% 98%; + --primary-foreground: 240 5.9% 10%; + + --secondary: 240 3.7% 15.9%; + --secondary-foreground: 0 0% 98%; + + /* Muted Text: Helligkeit massiv erhöht, damit Beschreibungen lesbar sind */ + --muted: 240 3.7% 15.9%; + --muted-foreground: 240 5% 75%; + /* Vorher 56.9% Helligkeit, jetzt 75% (viel heller) */ + + --accent: 240 3.7% 15.9%; + --accent-foreground: 0 0% 98%; + + --destructive: 0 72% 51%; + /* Helleres Rot für dunklen Hintergrund */ + --destructive-foreground: 0 0% 98%; + --border: 240 3.7% 25%; + /* Grenzen im Dunkeln besser sichtbar */ + --input: 240 3.7% 25%; + --ring: 240 4.9% 83.9%; + } +} + +/* Automatischer High-Contrast-Modus für Betriebssystem-Vorgaben */ +@media (prefers-contrast: more) { + :root { + --foreground: 0 0% 0%; + --muted-foreground: 0 0% 0%; + --border: 0 0% 0%; + } + + .dark { + --background: 0 0% 0%; + --foreground: 0 0% 100%; + --muted-foreground: 0 0% 100%; + --border: 0 0% 100%; } } @@ -53,6 +87,7 @@ * { @apply border-border; } + body { @apply bg-background text-foreground antialiased; font-feature-settings: "rlig" 1, "calt" 1; @@ -60,13 +95,17 @@ } @layer utilities { + + /* Glassmorphism Kontraste geschärft (höhere Deckkraft) */ .glass { - @apply bg-white/10 backdrop-blur-md border border-white/20; + @apply bg-white/20 backdrop-blur-md border border-white/40; } + .glass-dark { - @apply bg-black/20 backdrop-blur-md border border-white/10; + @apply bg-black/40 backdrop-blur-md border border-white/20; } + .text-gradient { - @apply bg-clip-text text-transparent bg-gradient-to-r from-primary to-blue-400; + @apply bg-clip-text text-transparent bg-gradient-to-r from-sky-500 to-blue-600 dark:from-primary dark:to-blue-400; } -} +} \ No newline at end of file diff --git a/shop/app/layout.tsx b/shop/app/layout.tsx index 288c3ab..34444df 100644 --- a/shop/app/layout.tsx +++ b/shop/app/layout.tsx @@ -32,8 +32,8 @@ export default function RootLayout({