Add custom gniza color theme based on user palette

Custom DaisyUI theme using the provided color palette:
- Primary: dark blue rgb(5,61,142)
- Secondary/Error: orange rgb(238,118,45)
- Accent/Warning: yellow rgb(254,204,0)
- Info: teal rgb(90,168,189)
- Neutral: darker blue rgb(2,44,105)
- Base: white/gray

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
shuki
2026-03-04 05:26:33 +02:00
parent 1d3ef21568
commit 6fc9c2e2b9
3 changed files with 47 additions and 5 deletions

File diff suppressed because one or more lines are too long

View File

@@ -3,8 +3,49 @@
@source "../*.cgi"; @source "../*.cgi";
@source "../lib/GnizaWHM/*.pm"; @source "../lib/GnizaWHM/*.pm";
@source "./safelist.html"; @source "./safelist.html";
@plugin "daisyui" { @plugin "daisyui";
themes: light --default; @plugin "daisyui/theme" {
name: "gniza";
default: true;
color-scheme: light;
--color-base-100: oklch(100% 0 0);
--color-base-200: oklch(97% 0 0);
--color-base-300: oklch(89.8% 0 0);
--color-base-content: oklch(30.9% 0.116 258.9);
--color-primary: oklch(38.2% 0.145 259.4);
--color-primary-content: oklch(100% 0 0);
--color-secondary: oklch(69.5% 0.169 47.8);
--color-secondary-content: oklch(100% 0 0);
--color-accent: oklch(86.4% 0.177 90.8);
--color-accent-content: oklch(30.9% 0.116 258.9);
--color-neutral: oklch(30.9% 0.116 258.9);
--color-neutral-content: oklch(100% 0 0);
--color-info: oklch(69% 0.083 217.5);
--color-info-content: oklch(100% 0 0);
--color-success: oklch(65% 0.25 140);
--color-success-content: oklch(100% 0 0);
--color-warning: oklch(86.4% 0.177 90.8);
--color-warning-content: oklch(30.9% 0.116 258.9);
--color-error: oklch(69.5% 0.169 47.8);
--color-error-content: oklch(100% 0 0);
--radius-selector: 0.5rem;
--radius-field: 0.25rem;
--radius-box: 0.5rem;
--size-selector: 0.25rem;
--size-field: 0.25rem;
--border: 1px;
--depth: 1;
--noise: 0;
} }
@theme { @theme {
--font-sans: 'Helvetica Neue', Helvetica, Arial, sans-serif; --font-sans: 'Helvetica Neue', Helvetica, Arial, sans-serif;

View File

@@ -630,7 +630,7 @@ sub page_header {
# (background, color, overflow, scrollbar) don't leak into WHM. # (background, color, overflow, scrollbar) don't leak into WHM.
$css = _scope_to_container($css); $css = _scope_to_container($css);
return qq{<style>$css</style>\n} return qq{<style>$css</style>\n}
. qq{<div data-theme="light" class="font-sans text-[2.3rem] bg-[#fafafa]">\n} . qq{<div data-theme="gniza" class="font-sans text-[2.3rem] bg-[#fafafa]">\n}
. qq{<h1 class="text-xl font-bold mb-4">$title</h1>\n}; . qq{<h1 class="text-xl font-bold mb-4">$title</h1>\n};
} }
@@ -682,6 +682,7 @@ sub _scope_to_container {
$css =~ s/:where\(:root\)/\&/g; $css =~ s/:where\(:root\)/\&/g;
$css =~ s/:root,\s*\[data-theme[^\]]*\]/\&/g; $css =~ s/:root,\s*\[data-theme[^\]]*\]/\&/g;
$css =~ s/\[data-theme=light\]/\&/g; $css =~ s/\[data-theme=light\]/\&/g;
$css =~ s/\[data-theme=gniza\]/\&/g;
$css =~ s/:root:not\(span\)/\&/g; $css =~ s/:root:not\(span\)/\&/g;
$css =~ s/:root:has\(/\&:has(/g; $css =~ s/:root:has\(/\&:has(/g;
$css =~ s/:root\b/\&/g; $css =~ s/:root\b/\&/g;
@@ -715,7 +716,7 @@ sub _scope_to_container {
} }
# Step 3: Wrap in container scope — & references resolve to this selector # Step 3: Wrap in container scope — & references resolve to this selector
return join('', @top_level) . '[data-theme="light"]{' . $scoped . '}'; return join('', @top_level) . '[data-theme="gniza"]{' . $scoped . '}';
} }
sub page_footer { sub page_footer {