Skip to content

An AI-powered search engine with a generative UI

feat: update CSS variables to use oklch color space

Yoshiki Miurad9aec1c19909
diff --git a/app/globals.css b/app/globals.css
index 27bd9ed4..fe9fc2fd 100644
--- a/app/globals.css
+++ b/app/globals.css
@@ -2,56 +2,163 @@
@custom-variant dark (&:is(.dark *));
-@theme {
- --color-border: hsl(var(--border));
- --color-input: hsl(var(--input));
- --color-ring: hsl(var(--ring));
- --color-background: hsl(var(--background));
- --color-foreground: hsl(var(--foreground));
-
- --color-primary: hsl(var(--primary));
- --color-primary-foreground: hsl(var(--primary-foreground));
-
- --color-secondary: hsl(var(--secondary));
- --color-secondary-foreground: hsl(var(--secondary-foreground));
-
- --color-destructive: hsl(var(--destructive));
- --color-destructive-foreground: hsl(var(--destructive-foreground));
-
- --color-muted: hsl(var(--muted));
- --color-muted-foreground: hsl(var(--muted-foreground));
-
- --color-accent: hsl(var(--accent));
- --color-accent-foreground: hsl(var(--accent-foreground));
-
- --color-accent-blue: hsl(var(--accent-blue));
- --color-accent-blue-foreground: hsl(var(--accent-blue-foreground));
- --color-accent-blue-border: hsl(var(--accent-blue-border));
-
- --color-popover: hsl(var(--popover));
- --color-popover-foreground: hsl(var(--popover-foreground));
-
- --color-card: hsl(var(--card));
- --color-card-foreground: hsl(var(--card-foreground));
+:root {
+ --background: oklch(0.99 0 0);
+ --foreground: oklch(0 0 0);
+ --card: oklch(1 0 0);
+ --card-foreground: oklch(0 0 0);
+ --popover: oklch(0.99 0 0);
+ --popover-foreground: oklch(0 0 0);
+ --primary: oklch(0 0 0);
+ --primary-foreground: oklch(1 0 0);
+ --secondary: oklch(0.94 0 0);
+ --secondary-foreground: oklch(0 0 0);
+ --muted: oklch(0.97 0 0);
+ --muted-foreground: oklch(0.44 0 0);
+ --accent: oklch(0.94 0 0);
+ --accent-foreground: oklch(0 0 0);
+ --destructive: oklch(0.63 0.19 23.03);
+ --destructive-foreground: oklch(1 0 0);
+ --border: oklch(0.92 0 0);
+ --input: oklch(0.94 0 0);
+ --ring: oklch(0 0 0);
+ --chart-1: oklch(0.81 0.17 75.35);
+ --chart-2: oklch(0.55 0.22 264.53);
+ --chart-3: oklch(0.72 0 0);
+ --chart-4: oklch(0.92 0 0);
+ --chart-5: oklch(0.56 0 0);
+ --sidebar: oklch(0.99 0 0);
+ --sidebar-foreground: oklch(0 0 0);
+ --sidebar-primary: oklch(0 0 0);
+ --sidebar-primary-foreground: oklch(1 0 0);
+ --sidebar-accent: oklch(0.94 0 0);
+ --sidebar-accent-foreground: oklch(0 0 0);
+ --sidebar-border: oklch(0.94 0 0);
+ --sidebar-ring: oklch(0 0 0);
+ --font-sans: Geist, sans-serif;
+ --font-serif: Georgia, serif;
+ --font-mono: Geist Mono, monospace;
+ --radius: 0.5rem;
+ --shadow-2xs: 0px 1px 2px 0px hsl(0 0% 0% / 0.09);
+ --shadow-xs: 0px 1px 2px 0px hsl(0 0% 0% / 0.09);
+ --shadow-sm:
+ 0px 1px 2px 0px hsl(0 0% 0% / 0.18), 0px 1px 2px -1px hsl(0 0% 0% / 0.18);
+ --shadow:
+ 0px 1px 2px 0px hsl(0 0% 0% / 0.18), 0px 1px 2px -1px hsl(0 0% 0% / 0.18);
+ --shadow-md:
+ 0px 1px 2px 0px hsl(0 0% 0% / 0.18), 0px 2px 4px -1px hsl(0 0% 0% / 0.18);
+ --shadow-lg:
+ 0px 1px 2px 0px hsl(0 0% 0% / 0.18), 0px 4px 6px -1px hsl(0 0% 0% / 0.18);
+ --shadow-xl:
+ 0px 1px 2px 0px hsl(0 0% 0% / 0.18), 0px 8px 10px -1px hsl(0 0% 0% / 0.18);
+ --shadow-2xl: 0px 1px 2px 0px hsl(0 0% 0% / 0.45);
+ --tracking-normal: 0em;
+ --spacing: 0.25rem;
+}
- --color-chart-1: hsl(var(--chart-1));
- --color-chart-2: hsl(var(--chart-2));
- --color-chart-3: hsl(var(--chart-3));
- --color-chart-4: hsl(var(--chart-4));
- --color-chart-5: hsl(var(--chart-5));
+.dark {
+ --background: oklch(0 0 0);
+ --foreground: oklch(1 0 0);
+ --card: oklch(0.14 0 0);
+ --card-foreground: oklch(1 0 0);
+ --popover: oklch(0.18 0 0);
+ --popover-foreground: oklch(1 0 0);
+ --primary: oklch(1 0 0);
+ --primary-foreground: oklch(0 0 0);
+ --secondary: oklch(0.25 0 0);
+ --secondary-foreground: oklch(1 0 0);
+ --muted: oklch(0.23 0 0);
+ --muted-foreground: oklch(0.72 0 0);
+ --accent: oklch(0.32 0 0);
+ --accent-foreground: oklch(1 0 0);
+ --destructive: oklch(0.69 0.2 23.91);
+ --destructive-foreground: oklch(0 0 0);
+ --border: oklch(0.26 0 0);
+ --input: oklch(0.32 0 0);
+ --ring: oklch(0.72 0 0);
+ --chart-1: oklch(0.81 0.17 75.35);
+ --chart-2: oklch(0.58 0.21 260.84);
+ --chart-3: oklch(0.56 0 0);
+ --chart-4: oklch(0.44 0 0);
+ --chart-5: oklch(0.92 0 0);
+ --sidebar: oklch(0.18 0 0);
+ --sidebar-foreground: oklch(1 0 0);
+ --sidebar-primary: oklch(1 0 0);
+ --sidebar-primary-foreground: oklch(0 0 0);
+ --sidebar-accent: oklch(0.32 0 0);
+ --sidebar-accent-foreground: oklch(1 0 0);
+ --sidebar-border: oklch(0.32 0 0);
+ --sidebar-ring: oklch(0.72 0 0);
+ --font-sans: Geist, sans-serif;
+ --font-serif: Georgia, serif;
+ --font-mono: Geist Mono, monospace;
+ --radius: 0.5rem;
+ --shadow-2xs: 0px 1px 2px 0px hsl(0 0% 0% / 0.09);
+ --shadow-xs: 0px 1px 2px 0px hsl(0 0% 0% / 0.09);
+ --shadow-sm:
+ 0px 1px 2px 0px hsl(0 0% 0% / 0.18), 0px 1px 2px -1px hsl(0 0% 0% / 0.18);
+ --shadow:
+ 0px 1px 2px 0px hsl(0 0% 0% / 0.18), 0px 1px 2px -1px hsl(0 0% 0% / 0.18);
+ --shadow-md:
+ 0px 1px 2px 0px hsl(0 0% 0% / 0.18), 0px 2px 4px -1px hsl(0 0% 0% / 0.18);
+ --shadow-lg:
+ 0px 1px 2px 0px hsl(0 0% 0% / 0.18), 0px 4px 6px -1px hsl(0 0% 0% / 0.18);
+ --shadow-xl:
+ 0px 1px 2px 0px hsl(0 0% 0% / 0.18), 0px 8px 10px -1px hsl(0 0% 0% / 0.18);
+ --shadow-2xl: 0px 1px 2px 0px hsl(0 0% 0% / 0.45);
+}
- --color-sidebar: hsl(var(--sidebar-background));
- --color-sidebar-foreground: hsl(var(--sidebar-foreground));
- --color-sidebar-primary: hsl(var(--sidebar-primary));
- --color-sidebar-primary-foreground: hsl(var(--sidebar-primary-foreground));
- --color-sidebar-accent: hsl(var(--sidebar-accent));
- --color-sidebar-accent-foreground: hsl(var(--sidebar-accent-foreground));
- --color-sidebar-border: hsl(var(--sidebar-border));
- --color-sidebar-ring: hsl(var(--sidebar-ring));
+@theme inline {
+ --color-background: var(--background);
+ --color-foreground: var(--foreground);
+ --color-card: var(--card);
+ --color-card-foreground: var(--card-foreground);
+ --color-popover: var(--popover);
+ --color-popover-foreground: var(--popover-foreground);
+ --color-primary: var(--primary);
+ --color-primary-foreground: var(--primary-foreground);
+ --color-secondary: var(--secondary);
+ --color-secondary-foreground: var(--secondary-foreground);
+ --color-muted: var(--muted);
+ --color-muted-foreground: var(--muted-foreground);
+ --color-accent: var(--accent);
+ --color-accent-foreground: var(--accent-foreground);
+ --color-destructive: var(--destructive);
+ --color-destructive-foreground: var(--destructive-foreground);
+ --color-border: var(--border);
+ --color-input: var(--input);
+ --color-ring: var(--ring);
+ --color-chart-1: var(--chart-1);
+ --color-chart-2: var(--chart-2);
+ --color-chart-3: var(--chart-3);
+ --color-chart-4: var(--chart-4);
+ --color-chart-5: var(--chart-5);
+ --color-sidebar: var(--sidebar);
+ --color-sidebar-foreground: var(--sidebar-foreground);
+ --color-sidebar-primary: var(--sidebar-primary);
+ --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
+ --color-sidebar-accent: var(--sidebar-accent);
+ --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
+ --color-sidebar-border: var(--sidebar-border);
+ --color-sidebar-ring: var(--sidebar-ring);
+
+ --font-sans: var(--font-sans);
+ --font-mono: var(--font-mono);
+ --font-serif: var(--font-serif);
- --radius-lg: var(--radius);
- --radius-md: calc(var(--radius) - 2px);
--radius-sm: calc(var(--radius) - 4px);
+ --radius-md: calc(var(--radius) - 2px);
+ --radius-lg: var(--radius);
+ --radius-xl: calc(var(--radius) + 4px);
+
+ --shadow-2xs: var(--shadow-2xs);
+ --shadow-xs: var(--shadow-xs);
+ --shadow-sm: var(--shadow-sm);
+ --shadow: var(--shadow);
+ --shadow-md: var(--shadow-md);
+ --shadow-lg: var(--shadow-lg);
+ --shadow-xl: var(--shadow-xl);
+ --shadow-2xl: var(--shadow-2xl);
--animate-accordion-down: accordion-down 0.2s ease-out;
--animate-accordion-up: accordion-up 0.2s ease-out;
@@ -61,10 +168,6 @@
--animate-slide-out-right: slide-out-right 0.3s ease-out;
--animate-fade-in: fade-in 0.3s ease-out;
- --font-sans:
- var(--font-sans), ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji',
- 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
-
@keyframes accordion-down {
from {
height: 0;
@@ -222,109 +325,6 @@
}
}
-@layer base {
- :root {
- --background: 0 0% 100%;
- --foreground: 0 0% 3.9%;
-
- --card: 0 0% 96.1%;
- --card-foreground: 0 0% 45.1%;
-
- --popover: 0 0% 100%;
- --popover-foreground: 0 0% 3.9%;
-
- --primary: 0 0% 9%;
- --primary-foreground: 0 0% 98%;
-
- --secondary: 0 0% 96.1%;
- --secondary-foreground: 0 0% 9%;
-
- --muted: 0 0% 96.1%;
- --muted-foreground: 0 0% 45.1%;
-
- --accent: 0 0% 96.1%;
- --accent-foreground: 0 0% 9%;
-
- --destructive: 0 84.2% 60.2%;
- --destructive-foreground: 0 0% 98%;
-
- --border: 0 0% 89.8%;
- --input: 0 0% 89.8%;
- --ring: 0 0% 89.8%;
-
- --radius: 0.5rem;
-
- --chart-1: 12 76% 61%;
-
- --chart-2: 173 58% 39%;
-
- --chart-3: 197 37% 24%;
-
- --chart-4: 43 74% 66%;
-
- --chart-5: 27 87% 67%;
-
- --accent-blue: 210 100% 97%;
- --accent-blue-foreground: 210 100% 50%;
- --accent-blue-border: 210 100% 90%;
- --sidebar-background: 0 0% 98%;
- --sidebar-foreground: 240 5.3% 26.1%;
- --sidebar-primary: 240 5.9% 10%;
- --sidebar-primary-foreground: 0 0% 98%;
- --sidebar-accent: 240 4.8% 95.9%;
- --sidebar-accent-foreground: 240 5.9% 10%;
- --sidebar-border: 220 13% 91%;
- --sidebar-ring: 217.2 91.2% 59.8%;
- }
-
- .dark {
- --background: 0 0% 3.9%;
- --foreground: 0 0% 98%;
-
- --card: 0 0% 14.9%;
- --card-foreground: 0 0% 63.9%;
-
- --popover: 0 0% 3.9%;
- --popover-foreground: 0 0% 98%;
-
- --primary: 0 0% 98%;
- --primary-foreground: 0 0% 9%;
-
- --secondary: 0 0% 14.9%;
- --secondary-foreground: 0 0% 98%;
-
- --muted: 0 0% 14.9%;
- --muted-foreground: 0 0% 63.9%;
-
- --accent: 0 0% 14.9%;
- --accent-foreground: 0 0% 98%;
-
- --destructive: 0 62.8% 30.6%;
- --destructive-foreground: 0 0% 98%;
-
- --border: 0 0% 14.9%;
- --input: 0 0% 14.9%;
- --ring: 0 0% 14.9%;
- --chart-1: 220 70% 50%;
- --chart-2: 160 60% 45%;
- --chart-3: 30 80% 55%;
- --chart-4: 280 65% 60%;
- --chart-5: 340 75% 55%;
-
- --accent-blue: 210 100% 10%;
- --accent-blue-foreground: 210 100% 80%;
- --accent-blue-border: 210 100% 25%;
- --sidebar-background: 240 5.9% 10%;
- --sidebar-foreground: 240 4.8% 95.9%;
- --sidebar-primary: 224.3 76.3% 48%;
- --sidebar-primary-foreground: 0 0% 100%;
- --sidebar-accent: 240 3.7% 15.9%;
- --sidebar-accent-foreground: 240 4.8% 95.9%;
- --sidebar-border: 240 3.7% 15.9%;
- --sidebar-ring: 217.2 91.2% 59.8%;
- }
-}
-
@layer base {
* {
@apply border-border;