mirror of
https://github.com/jnsahaj/tweakcn.git
synced 2026-08-29 07:14:31 +08:00
cbd0ac431b
This reverts commit 88261b5c86.
138 lines
4.4 KiB
TypeScript
138 lines
4.4 KiB
TypeScript
import { ThemeEditorState } from "../types/editor";
|
|
|
|
// these are common between light and dark modes
|
|
// we can assume that light mode's value will be used for dark mode as well
|
|
export const COMMON_STYLES = [
|
|
"font-sans",
|
|
"font-serif",
|
|
"font-mono",
|
|
"radius",
|
|
"shadow-opacity",
|
|
"shadow-blur",
|
|
"shadow-spread",
|
|
"shadow-offset-x",
|
|
"shadow-offset-y",
|
|
"letter-spacing",
|
|
"spacing",
|
|
];
|
|
|
|
export const DEFAULT_FONT_SANS =
|
|
"ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'";
|
|
|
|
export const DEFAULT_FONT_SERIF = 'ui-serif, Georgia, Cambria, "Times New Roman", Times, serif';
|
|
|
|
export const DEFAULT_FONT_MONO =
|
|
'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace';
|
|
|
|
// Default light theme styles
|
|
export const defaultLightThemeStyles = {
|
|
background: "oklch(1 0 0)",
|
|
foreground: "oklch(0.145 0 0)",
|
|
card: "oklch(1 0 0)",
|
|
"card-foreground": "oklch(0.145 0 0)",
|
|
popover: "oklch(1 0 0)",
|
|
"popover-foreground": "oklch(0.145 0 0)",
|
|
primary: "oklch(0.205 0 0)",
|
|
"primary-foreground": "oklch(0.985 0 0)",
|
|
secondary: "oklch(0.97 0 0)",
|
|
"secondary-foreground": "oklch(0.205 0 0)",
|
|
muted: "oklch(0.97 0 0)",
|
|
"muted-foreground": "oklch(0.556 0 0)",
|
|
accent: "oklch(0.97 0 0)",
|
|
"accent-foreground": "oklch(0.205 0 0)",
|
|
destructive: "oklch(0.577 0.245 27.325)",
|
|
"destructive-foreground": "oklch(1 0 0)",
|
|
border: "oklch(0.922 0 0)",
|
|
input: "oklch(0.922 0 0)",
|
|
ring: "oklch(0.708 0 0)",
|
|
"chart-1": "oklch(0.81 0.10 252)",
|
|
"chart-2": "oklch(0.62 0.19 260)",
|
|
"chart-3": "oklch(0.55 0.22 263)",
|
|
"chart-4": "oklch(0.49 0.22 264)",
|
|
"chart-5": "oklch(0.42 0.18 266)",
|
|
radius: "0.625rem",
|
|
sidebar: "oklch(0.985 0 0)",
|
|
"sidebar-foreground": "oklch(0.145 0 0)",
|
|
"sidebar-primary": "oklch(0.205 0 0)",
|
|
"sidebar-primary-foreground": "oklch(0.985 0 0)",
|
|
"sidebar-accent": "oklch(0.97 0 0)",
|
|
"sidebar-accent-foreground": "oklch(0.205 0 0)",
|
|
"sidebar-border": "oklch(0.922 0 0)",
|
|
"sidebar-ring": "oklch(0.708 0 0)",
|
|
"font-sans": DEFAULT_FONT_SANS,
|
|
"font-serif": DEFAULT_FONT_SERIF,
|
|
"font-mono": DEFAULT_FONT_MONO,
|
|
|
|
"shadow-color": "oklch(0 0 0)",
|
|
"shadow-opacity": "0.1",
|
|
"shadow-blur": "3px",
|
|
"shadow-spread": "0px",
|
|
"shadow-offset-x": "0",
|
|
"shadow-offset-y": "1px",
|
|
|
|
"letter-spacing": "0em",
|
|
spacing: "0.25rem",
|
|
};
|
|
|
|
// Default dark theme styles
|
|
export const defaultDarkThemeStyles = {
|
|
...defaultLightThemeStyles,
|
|
background: "oklch(0.145 0 0)",
|
|
foreground: "oklch(0.985 0 0)",
|
|
card: "oklch(0.205 0 0)",
|
|
"card-foreground": "oklch(0.985 0 0)",
|
|
popover: "oklch(0.269 0 0)",
|
|
"popover-foreground": "oklch(0.985 0 0)",
|
|
primary: "oklch(0.922 0 0)",
|
|
"primary-foreground": "oklch(0.205 0 0)",
|
|
secondary: "oklch(0.269 0 0)",
|
|
"secondary-foreground": "oklch(0.985 0 0)",
|
|
muted: "oklch(0.269 0 0)",
|
|
"muted-foreground": "oklch(0.708 0 0)",
|
|
accent: "oklch(0.371 0 0)",
|
|
"accent-foreground": "oklch(0.985 0 0)",
|
|
destructive: "oklch(0.704 0.191 22.216)",
|
|
"destructive-foreground": "oklch(0.985 0 0)",
|
|
border: "oklch(0.275 0 0)", // in place of oklch(1 0 0 / 10%)
|
|
input: "oklch(0.325 0 0)", // in place of oklch(1 0 0 / 15%)
|
|
ring: "oklch(0.556 0 0)",
|
|
"chart-1": "oklch(0.81 0.10 252)",
|
|
"chart-2": "oklch(0.62 0.19 260)",
|
|
"chart-3": "oklch(0.55 0.22 263)",
|
|
"chart-4": "oklch(0.49 0.22 264)",
|
|
"chart-5": "oklch(0.42 0.18 266)",
|
|
// Actual has radius but not in Expected, keeping it as is
|
|
radius: "0.625rem",
|
|
// Converting sidebar-related variables to match Actual format
|
|
sidebar: "oklch(0.205 0 0)",
|
|
"sidebar-foreground": "oklch(0.985 0 0)",
|
|
"sidebar-primary": "oklch(0.488 0.243 264.376)",
|
|
"sidebar-primary-foreground": "oklch(0.985 0 0)",
|
|
"sidebar-accent": "oklch(0.269 0 0)",
|
|
"sidebar-accent-foreground": "oklch(0.985 0 0)",
|
|
"sidebar-border": "oklch(0.275 0 0)", // in place of oklch(1 0 0 / 10%)
|
|
"sidebar-ring": "oklch(0.439 0 0)",
|
|
|
|
"shadow-color": "oklch(0 0 0)",
|
|
|
|
"letter-spacing": "0em",
|
|
spacing: "0.25rem",
|
|
};
|
|
|
|
// Default theme state
|
|
export const defaultThemeState: ThemeEditorState = {
|
|
styles: {
|
|
light: defaultLightThemeStyles,
|
|
dark: defaultDarkThemeStyles,
|
|
},
|
|
currentMode:
|
|
typeof window !== "undefined" && window.matchMedia("(prefers-color-scheme: dark)").matches
|
|
? "dark"
|
|
: "light",
|
|
hslAdjustments: {
|
|
hueShift: 0,
|
|
saturationScale: 1,
|
|
lightnessScale: 1,
|
|
},
|
|
};
|