94 lines
45 KiB
JavaScript
94 lines
45 KiB
JavaScript
|
|
/** 🌼
|
|||
|
|
* @license MIT
|
|||
|
|
* daisyUI bundle
|
|||
|
|
* https://daisyui.com/
|
|||
|
|
*/
|
|||
|
|
|
|||
|
|
// packages/daisyui/functions/plugin.js
|
|||
|
|
var plugin = {
|
|||
|
|
withOptions: (pluginFunction, configFunction = () => ({})) => {
|
|||
|
|
const optionsFunction = (options) => {
|
|||
|
|
const handler = pluginFunction(options);
|
|||
|
|
const config = configFunction(options);
|
|||
|
|
return { handler, config };
|
|||
|
|
};
|
|||
|
|
optionsFunction.__isOptionsFunction = true;
|
|||
|
|
return optionsFunction;
|
|||
|
|
}
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
// packages/daisyui/theme/object.js
|
|||
|
|
var object_default = { emerald: { "color-scheme": "light", "--color-base-100": "oklch(100% 0 0)", "--color-base-200": "oklch(93% 0 0)", "--color-base-300": "oklch(86% 0 0)", "--color-base-content": "oklch(35.519% 0.032 262.988)", "--color-primary": "oklch(76.662% 0.135 153.45)", "--color-primary-content": "oklch(33.387% 0.04 162.24)", "--color-secondary": "oklch(61.302% 0.202 261.294)", "--color-secondary-content": "oklch(100% 0 0)", "--color-accent": "oklch(72.772% 0.149 33.2)", "--color-accent-content": "oklch(0% 0 0)", "--color-neutral": "oklch(35.519% 0.032 262.988)", "--color-neutral-content": "oklch(98.462% 0.001 247.838)", "--color-info": "oklch(72.06% 0.191 231.6)", "--color-info-content": "oklch(0% 0 0)", "--color-success": "oklch(64.8% 0.15 160)", "--color-success-content": "oklch(0% 0 0)", "--color-warning": "oklch(84.71% 0.199 83.87)", "--color-warning-content": "oklch(0% 0 0)", "--color-error": "oklch(71.76% 0.221 22.18)", "--color-error-content": "oklch(0% 0 0)", "--radius-selector": "1rem", "--radius-field": "0.5rem", "--radius-box": "1rem", "--size-selector": "0.25rem", "--size-field": "0.25rem", "--border": "1px", "--depth": "0", "--noise": "0" }, luxury: { "color-scheme": "dark", "--color-base-100": "oklch(14.076% 0.004 285.822)", "--color-base-200": "oklch(20.219% 0.004 308.229)", "--color-base-300": "oklch(23.219% 0.004 308.229)", "--color-base-content": "oklch(75.687% 0.123 76.89)", "--color-primary": "oklch(100% 0 0)", "--color-primary-content": "oklch(20% 0 0)", "--color-secondary": "oklch(27.581% 0.064 261.069)", "--color-secondary-content": "oklch(85.516% 0.012 261.069)", "--color-accent": "oklch(36.674% 0.051 338.825)", "--color-accent-content": "oklch(87.334% 0.01 338.825)", "--color-neutral": "oklch(24.27% 0.057 59.825)", "--color-neutral-content": "oklch(93.203% 0.089 90.861)", "--color-info": "oklch(79.061% 0.121 237.133)", "--color-info-content": "oklch(15.812% 0.024 237.133)", "--color-success": "oklch(78.119% 0.192 132.154)", "--color-success-content": "oklch(15.623% 0.038 132.154)", "--color-warning": "oklch(86.127% 0.136 102.891)", "--color-warning-content": "oklch(17.225% 0.027 102.891)", "--color-error": "oklch(71.753% 0.176 22.568)", "--color-error-content": "oklch(14.35% 0.035 22.568)", "--radius-selector": "1rem", "--radius-field": "0.5rem", "--radius-box": "1rem", "--size-selector": "0.25rem", "--size-field": "0.25rem", "--border": "1px", "--depth": "1", "--noise": "0" }, autumn: { "color-scheme": "light", "--color-base-100": "oklch(95.814% 0 0)", "--color-base-200": "oklch(89.107% 0 0)", "--color-base-300": "oklch(82.4% 0 0)", "--color-base-content": "oklch(19.162% 0 0)", "--color-primary": "oklch(40.723% 0.161 17.53)", "--color-primary-content": "oklch(88.144% 0.032 17.53)", "--color-secondary": "oklch(61.676% 0.169 23.865)", "--color-secondary-content": "oklch(12.335% 0.033 23.865)", "--color-accent": "oklch(73.425% 0.094 60.729)", "--color-accent-content": "oklch(14.685% 0.018 60.729)", "--color-neutral": "oklch(54.367% 0.037 51.902)", "--color-neutral-content": "oklch(90.873% 0.007 51.902)", "--color-info": "oklch(69.224% 0.097 207.284)", "--color-info-content": "oklch(13.844% 0.019 207.284)", "--color-success": "oklch(60.995% 0.08 174.616)", "--color-success-content": "oklch(12.199% 0.016 174.616)", "--color-warning": "oklch(70.081% 0.164 56.844)", "--color-warning-content": "oklch(14.016% 0.032 56.844)", "--color-error": "oklch(53.07% 0.241 24.16)", "--color-error-content": "oklch(90.614% 0.048 24.16)", "--radius-selector": "1rem", "--radius-field": "0.5rem", "--radius-box": "1rem", "--size-selector": "0.25rem", "--size-field": "0.25rem", "--border": "1px", "--depth": "1", "--noise": "0" }, wireframe: { "color-scheme": "light", "--color-base-100": "oklch(100% 0 0)", "--color-base-200": "oklch(97% 0 0)", "--color-base-300": "oklch(94% 0 0)", "--color-base-content": "oklch(20% 0 0)", "--color-primary": "oklch(87% 0 0)", "--color-primary-content": "oklch(26% 0 0)", "--color-secondary": "oklch(87% 0 0)", "--color-secondary-content": "oklch(26% 0 0)", "--color-accent": "oklch(8
|
|||
|
|
|
|||
|
|
// packages/daisyui/theme/index.js
|
|||
|
|
var theme_default = plugin.withOptions((options = {}) => {
|
|||
|
|
return ({ addBase }) => {
|
|||
|
|
const {
|
|||
|
|
name = "custom-theme",
|
|||
|
|
default: isDefault = false,
|
|||
|
|
prefersdark = false,
|
|||
|
|
"color-scheme": colorScheme = "normal",
|
|||
|
|
root = ":root",
|
|||
|
|
...customThemeTokens
|
|||
|
|
} = options;
|
|||
|
|
let selector = `${root}:has(input.theme-controller[value=${name}]:checked),[data-theme="${name}"]`;
|
|||
|
|
if (isDefault) {
|
|||
|
|
selector = `:where(${root}),${selector}`;
|
|||
|
|
}
|
|||
|
|
let themeTokens = { ...customThemeTokens };
|
|||
|
|
if (object_default[name]) {
|
|||
|
|
const builtinTheme = object_default[name];
|
|||
|
|
themeTokens = {
|
|||
|
|
...builtinTheme,
|
|||
|
|
...customThemeTokens,
|
|||
|
|
"color-scheme": colorScheme || builtinTheme.colorScheme
|
|||
|
|
};
|
|||
|
|
}
|
|||
|
|
const baseStyles = {
|
|||
|
|
[selector]: {
|
|||
|
|
"color-scheme": themeTokens["color-scheme"] || colorScheme,
|
|||
|
|
...themeTokens
|
|||
|
|
}
|
|||
|
|
};
|
|||
|
|
if (prefersdark) {
|
|||
|
|
const darkSelector = root === ":root" ? ":root:not([data-theme])" : `${root}:not([data-theme])`;
|
|||
|
|
addBase({
|
|||
|
|
"@media (prefers-color-scheme: dark)": {
|
|||
|
|
[darkSelector]: baseStyles[selector]
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
addBase(baseStyles);
|
|||
|
|
};
|
|||
|
|
});
|
|||
|
|
export {
|
|||
|
|
theme_default as default
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
|
|||
|
|
/*
|
|||
|
|
|
|||
|
|
MIT License
|
|||
|
|
|
|||
|
|
Copyright (c) 2020 Pouya Saadeghi – https://daisyui.com
|
|||
|
|
|
|||
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|||
|
|
of this software and associated documentation files (the "Software"), to deal
|
|||
|
|
in the Software without restriction, including without limitation the rights
|
|||
|
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|||
|
|
copies of the Software, and to permit persons to whom the Software is
|
|||
|
|
furnished to do so, subject to the following conditions:
|
|||
|
|
|
|||
|
|
The above copyright notice and this permission notice shall be included in all
|
|||
|
|
copies or substantial portions of the Software.
|
|||
|
|
|
|||
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|||
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|||
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|||
|
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|||
|
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|||
|
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|||
|
|
SOFTWARE.
|
|||
|
|
|
|||
|
|
*/
|