nonebot2/website/tailwind.config.ts

48 lines
1.1 KiB
TypeScript
Raw Normal View History

2024-09-15 14:52:03 +00:00
const lightTheme = require("daisyui/src/theming/themes")["light"];
const darkTheme = require("daisyui/src/theming/themes")["dark"];
2024-09-15 14:52:03 +00:00
function excludeThemeColor(
theme: { [key: string]: string },
exclude: string[]
): { [key: string]: string } {
/** @type {typeof theme} */
2024-09-15 14:52:03 +00:00
const newObj: { [key: string]: string } = {};
for (const key in theme) {
if (exclude.includes(key)) continue;
2024-09-15 14:52:03 +00:00
newObj[key] = theme[key]!;
}
return newObj;
}
2024-09-15 14:52:03 +00:00
export default {
darkMode: ["class", '[data-theme="dark"]'],
daisyui: {
themes: [
{
2021-12-03 08:21:24 +00:00
light: {
...excludeThemeColor(lightTheme, [
"primary-content",
"secondary-content",
"accent-content",
]),
primary: "#ea5252",
secondary: "#ef9fbc",
accent: "#65c3c8",
2021-12-03 08:21:24 +00:00
},
},
{
dark: {
...excludeThemeColor(darkTheme, [
"primary-content",
"secondary-content",
"accent-content",
]),
primary: "#ea5252",
secondary: "#ef9fbc",
accent: "#65c3c8",
2021-12-03 08:21:24 +00:00
},
},
],
2021-12-03 08:21:24 +00:00
},
};