diff --git a/src/lib/components/ColorPicker.svelte b/src/lib/components/ColorPicker.svelte
index 992c866..adf274b 100644
--- a/src/lib/components/ColorPicker.svelte
+++ b/src/lib/components/ColorPicker.svelte
@@ -35,7 +35,8 @@
color = v;
} else {
mode = 'color';
- color = '#000000';
+ // Show the default color in the picker when no custom value is set
+ color = defaultValue && defaultValue.startsWith('#') ? defaultValue : '#000000';
}
});
@@ -50,15 +51,20 @@
}
function switchMode(newMode: 'color' | 'gradient') {
+ if (mode === newMode) return;
mode = newMode;
if (newMode === 'color') {
+ // Restore from default if available, not leftover gradient state
+ if (!value || value.startsWith('linear-gradient') || value.startsWith('radial-gradient')) {
+ color = defaultValue && defaultValue.startsWith('#') ? defaultValue : '#000000';
+ }
emitColor();
} else {
emitGradient();
}
}
- function clear() {
+ function resetToDefault() {
value = '';
onchange?.('');
}
@@ -68,7 +74,9 @@
{#if value}
-
+
{:else if defaultValue}
Default
{/if}
@@ -103,7 +111,7 @@
type="text"
bind:value={color}
oninput={emitColor}
- placeholder="#000000"
+ placeholder={defaultValue || '#000000'}
class="flex-1 rounded border border-gray-300 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-100 px-2 py-1 text-xs font-mono focus:border-[var(--color-primary)] focus:outline-none"
/>
diff --git a/src/routes/admin/branding/+page.svelte b/src/routes/admin/branding/+page.svelte
index 77bb1d1..878a0a5 100644
--- a/src/routes/admin/branding/+page.svelte
+++ b/src/routes/admin/branding/+page.svelte
@@ -358,37 +358,45 @@
Accent Colors
-
-
setField('primary', v)}
- />
- setField('primaryHover', v)}
- />
- setField('danger', v)}
- />
- setField('dangerHover', v)}
- />
+
+
+
+ setField('primary', v)}
+ />
+ setField('primaryHover', v)}
+ />
+
+
+
+ setField('danger', v)}
+ />
+ setField('dangerHover', v)}
+ />
+
+
setField('success', v)}
/>
+
Preview
Pounce
@@ -421,13 +429,13 @@
{#each ['To Do', 'In Progress', 'Done'] as colTitle}
{colTitle}
{#each [1, 2] as _}
@@ -437,10 +445,10 @@
-
Primary
-
Danger
-
Success
-
Warning
+
Primary
+
Danger
+
Success
+
Warning