mirror of
https://github.com/nonebot/nonebot2.git
synced 2024-11-24 00:55:07 +08:00
50 lines
1.2 KiB
JavaScript
50 lines
1.2 KiB
JavaScript
const lightTheme = require("daisyui/src/theming/themes")["[data-theme=light]"];
|
|
const darkTheme = require("daisyui/src/theming/themes")["[data-theme=dark]"];
|
|
|
|
/**
|
|
* @param {{[key: string]: string}} theme
|
|
* @param {string[]} exclude
|
|
* @returns {{[key: string]: string}}
|
|
*/
|
|
function excludeThemeColor(theme, exclude) {
|
|
/** @type {typeof theme} */
|
|
const newObj = {};
|
|
for (const key in theme) {
|
|
if (exclude.includes(key)) continue;
|
|
newObj[key] = theme[key];
|
|
}
|
|
return newObj;
|
|
}
|
|
|
|
module.exports = {
|
|
darkMode: ["class", '[data-theme="dark"]'],
|
|
daisyui: {
|
|
themes: [
|
|
{
|
|
light: {
|
|
...excludeThemeColor(lightTheme, [
|
|
"primary-content",
|
|
"secondary-content",
|
|
"accent-content",
|
|
]),
|
|
primary: "#ea5252",
|
|
secondary: "#ef9fbc",
|
|
accent: "#65c3c8",
|
|
},
|
|
},
|
|
{
|
|
dark: {
|
|
...excludeThemeColor(darkTheme, [
|
|
"primary-content",
|
|
"secondary-content",
|
|
"accent-content",
|
|
]),
|
|
primary: "#ea5252",
|
|
secondary: "#ef9fbc",
|
|
accent: "#65c3c8",
|
|
},
|
|
},
|
|
],
|
|
},
|
|
};
|