feat(01-02): design token system, i18n framework, and theme provider setup

- OKLCH design tokens with yellow #ffed00 primary and dark gray-blue dark mode
- next-intl cookie-based locale with DE/EN message files
- next-themes provider with system/light/dark support
- Sidebar and header layout dimension tokens
- Root layout with ThemeProvider and NextIntlClientProvider wrappers
This commit is contained in:
2026-06-18 10:22:42 +02:00
parent 0517e2b2b9
commit f3791c6cdd
8 changed files with 679 additions and 20 deletions
+97
View File
@@ -1 +1,98 @@
@import "tailwindcss";
@theme inline {
--color-primary: var(--primary);
--color-primary-foreground: var(--primary-foreground);
--color-secondary: var(--secondary);
--color-secondary-foreground: var(--secondary-foreground);
--color-accent: var(--accent);
--color-accent-foreground: var(--accent-foreground);
--color-background: var(--background);
--color-foreground: var(--foreground);
--color-card: var(--card);
--color-card-foreground: var(--card-foreground);
--color-muted: var(--muted);
--color-muted-foreground: var(--muted-foreground);
--color-destructive: var(--destructive);
--color-destructive-foreground: var(--destructive-foreground);
--color-border: var(--border);
--color-input: var(--input);
--color-ring: var(--ring);
--color-sidebar: var(--sidebar);
--color-sidebar-foreground: var(--sidebar-foreground);
--color-sidebar-accent: var(--sidebar-accent);
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
--color-sidebar-border: var(--sidebar-border);
--radius-sm: calc(var(--radius) - 2px);
--radius-md: var(--radius);
--radius-lg: calc(var(--radius) + 2px);
}
:root {
--radius: 0.5rem;
--font-sans: "Inter", system-ui, -apple-system, sans-serif;
/* Layout dimensions */
--sidebar-width: 240px;
--sidebar-width-collapsed: 64px;
--header-height: 60px;
/* Light mode colors (OKLCH) */
--background: oklch(0.99 0 0);
--foreground: oklch(0.15 0 0);
--card: oklch(1 0 0);
--card-foreground: oklch(0.15 0 0);
--primary: oklch(0.91 0.19 102);
--primary-foreground: oklch(0.20 0.02 90);
--secondary: oklch(0.96 0 0);
--secondary-foreground: oklch(0.15 0 0);
--muted: oklch(0.96 0 0);
--muted-foreground: oklch(0.55 0 0);
--accent: oklch(0.96 0 0);
--accent-foreground: oklch(0.15 0 0);
--destructive: oklch(0.55 0.2 27);
--destructive-foreground: oklch(0.98 0 0);
--border: oklch(0.90 0 0);
--input: oklch(0.90 0 0);
--ring: oklch(0.91 0.19 102);
/* Sidebar tokens */
--sidebar: oklch(0.97 0 0);
--sidebar-foreground: oklch(0.15 0 0);
--sidebar-accent: oklch(0.91 0.19 102 / 0.1);
--sidebar-accent-foreground: oklch(0.91 0.19 102);
--sidebar-border: oklch(0.90 0 0);
}
.dark {
--background: oklch(0.17 0.01 260);
--foreground: oklch(0.95 0 0);
--card: oklch(0.21 0.01 260);
--card-foreground: oklch(0.95 0 0);
--primary: oklch(0.91 0.19 102);
--primary-foreground: oklch(0.20 0.02 90);
--secondary: oklch(0.25 0.01 260);
--secondary-foreground: oklch(0.95 0 0);
--muted: oklch(0.25 0.01 260);
--muted-foreground: oklch(0.65 0 0);
--accent: oklch(0.25 0.01 260);
--accent-foreground: oklch(0.95 0 0);
--destructive: oklch(0.55 0.2 27);
--destructive-foreground: oklch(0.98 0 0);
--border: oklch(0.30 0.01 260);
--input: oklch(0.30 0.01 260);
--ring: oklch(0.91 0.19 102);
/* Sidebar tokens (dark) */
--sidebar: oklch(0.14 0.01 260);
--sidebar-foreground: oklch(0.95 0 0);
--sidebar-accent: oklch(0.91 0.19 102 / 0.15);
--sidebar-accent-foreground: oklch(0.91 0.19 102);
--sidebar-border: oklch(0.30 0.01 260);
}
body {
font-family: var(--font-sans);
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
+19 -4
View File
@@ -1,4 +1,7 @@
import type { Metadata } from 'next';
import { NextIntlClientProvider } from 'next-intl';
import { getLocale, getMessages } from 'next-intl/server';
import { ThemeProvider } from 'next-themes';
import './globals.css';
export const metadata: Metadata = {
@@ -6,15 +9,27 @@ export const metadata: Metadata = {
description: 'Modulare Workflow-Plattform',
};
export default function RootLayout({
export default async function RootLayout({
children,
}: {
children: React.ReactNode;
}) {
const locale = await getLocale();
const messages = await getMessages();
return (
<html lang="de">
<body className="antialiased">
{children}
<html lang={locale} suppressHydrationWarning>
<body className="font-sans antialiased bg-background text-foreground">
<ThemeProvider
attribute="class"
defaultTheme="system"
enableSystem
disableTransitionOnChange
>
<NextIntlClientProvider messages={messages}>
{children}
</NextIntlClientProvider>
</ThemeProvider>
</body>
</html>
);
+12
View File
@@ -0,0 +1,12 @@
import { getRequestConfig } from 'next-intl/server';
import { cookies } from 'next/headers';
export default getRequestConfig(async () => {
const cookieStore = await cookies();
const locale = cookieStore.get('NEXT_LOCALE')?.value || 'de';
return {
locale,
messages: (await import(`../messages/${locale}.json`)).default,
};
});
+40
View File
@@ -0,0 +1,40 @@
{
"common": {
"appName": "Tessera",
"loading": "Laden...",
"save": "Speichern",
"cancel": "Abbrechen"
},
"header": {
"search": "Suchen...",
"userMenu": "Benutzermenu",
"breadcrumb": {
"home": "Startseite"
}
},
"sidebar": {
"dashboard": "Dashboard",
"marketplace": "Marktplatz",
"settings": "Einstellungen",
"collapse": "Einklappen",
"expand": "Ausklappen",
"categories": {
"label": "Kategorien",
"empty": "Keine Module"
}
},
"dashboard": {
"title": "Dashboard",
"empty": "Keine Widgets aktiv",
"addWidget": "Widget hinzufuegen"
},
"theme": {
"light": "Hell",
"dark": "Dunkel",
"system": "System"
},
"locale": {
"de": "Deutsch",
"en": "English"
}
}
+40
View File
@@ -0,0 +1,40 @@
{
"common": {
"appName": "Tessera",
"loading": "Loading...",
"save": "Save",
"cancel": "Cancel"
},
"header": {
"search": "Search...",
"userMenu": "User menu",
"breadcrumb": {
"home": "Home"
}
},
"sidebar": {
"dashboard": "Dashboard",
"marketplace": "Marketplace",
"settings": "Settings",
"collapse": "Collapse",
"expand": "Expand",
"categories": {
"label": "Categories",
"empty": "No modules"
}
},
"dashboard": {
"title": "Dashboard",
"empty": "No active widgets",
"addWidget": "Add widget"
},
"theme": {
"light": "Light",
"dark": "Dark",
"system": "System"
},
"locale": {
"de": "Deutsch",
"en": "English"
}
}