示例工程 22-theming-and-native-appearance
22-theming-and-native-appearance/app/src/styles/globals.css
@import "tailwindcss";
@import "tw-animate-css";
@custom-variant dark (&:where(.dark, .dark *));
@theme {
--color-primary: #2563eb;
--color-primary-foreground: #ffffff;
--color-primary-soft: #dbeafe;
--color-surface: #ffffff;
--color-panel: #f8fafc;
--color-border: #e2e8f0;
--color-text: #0f172a;
--color-muted: #64748b;
--color-destructive: #dc2626;
--color-ring: #2563eb;
--radius-card: 8px;
--font-sans:
system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
--font-mono:
ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}
.dark {
--color-primary: #60a5fa;
--color-primary-foreground: #0f172a;
--color-primary-soft: #1e3a8a;
--color-surface: #0f172a;
--color-panel: #1e293b;
--color-border: #334155;
--color-text: #e2e8f0;
--color-muted: #94a3b8;
--color-destructive: #f87171;
--color-ring: #60a5fa;
}
html,
body,
#root {
min-height: 100%;
}
body {
margin: 0;
background-color: var(--color-surface);
color: var(--color-text);
font-family: var(--font-sans);
font-size: 14px;
line-height: 1.65;
}
.titlebar {
-webkit-app-region: drag;
user-select: none;
}
.titlebar button,
.titlebar input,
.titlebar select,
.no-drag {
-webkit-app-region: no-drag;
}
.show-regions .titlebar {
outline: 2px dashed #2563eb;
outline-offset: -4px;
}
.show-regions .no-drag {
outline: 1px dashed #f59e0b;
outline-offset: -2px;
}
.swatch-grid {
display: grid;
grid-template-columns: repeat(3, minmax(0, 1fr));
gap: 0.5rem;
}