diff --git a/src/app.css b/src/app.css index bbeca6acaa..65693bf77c 100644 --- a/src/app.css +++ b/src/app.css @@ -169,16 +169,16 @@ li p { :where(html:not(.native-scrollbars), html:not(.native-scrollbars) *)::-webkit-scrollbar-thumb { --tw-border-opacity: 1; - background-color: rgba(215, 215, 215, 0.6); - border-color: rgba(255, 255, 255, var(--tw-border-opacity)); + background-color: color-mix(in oklab, var(--color-base-300) 60%, transparent); + border-color: var(--color-base-0); border-radius: 9999px; border-width: 1px; } /* Dark theme scrollbar styles */ :where(html:not(.native-scrollbars)).dark ::-webkit-scrollbar-thumb { - background-color: rgba(67, 67, 67, 0.6); /* Darker color for dark theme */ - border-color: rgba(0, 0, 0, var(--tw-border-opacity)); + background-color: color-mix(in oklab, var(--color-base-700) 60%, transparent); + border-color: var(--color-base-1000); } :where(html:not(.native-scrollbars), html:not(.native-scrollbars) *)::-webkit-scrollbar { @@ -215,7 +215,7 @@ select { } .dark select option { - @apply bg-base-850 text-white; + @apply bg-base-850 text-base-0; } @keyframes shimmer { @@ -231,11 +231,11 @@ select { position: relative; overflow: hidden; clip-path: inset(0); - -webkit-text-fill-color: #b4b4b4; - color: #b4b4b4; + -webkit-text-fill-color: var(--color-base-400); + color: var(--color-base-400); } -/* Brightens #b4b4b4 text to #e8e8e8. */ +/* Brightens the base-400 text towards base-100. */ .shimmer::after { content: ''; position: absolute; @@ -381,11 +381,11 @@ input[type='number'] { } .cm-gutters { - @apply !bg-white dark:!bg-black !border-none; + @apply !bg-base-0 dark:!bg-base-1000 !border-none; } .cm-editor { - @apply bg-white dark:bg-black; + @apply bg-base-0 dark:bg-base-1000; } .tippy-box[data-theme~='dark'] { @@ -416,7 +416,7 @@ input[type='number'] { } .bg-base-950-90 { - background-color: rgba(var(--color-base-950, #0d0d0d), 0.9); + background-color: color-mix(in oklab, var(--color-base-950) 90%, transparent); } .ProseMirror { @@ -451,15 +451,13 @@ html.high-contrast :is(input, textarea, [contenteditable='true'], .ProseMirror): .ProseMirror p.is-editor-empty:first-child::before { content: attr(data-placeholder); float: left; - /* Below color is from tailwind, and has the proper contrast - text-base-600 from: https://tailwindcss.com/docs/color */ - color: #676767; + color: var(--color-base-600); pointer-events: none; @apply line-clamp-1 absolute; } -/* #676767 is 3.17:1 on the dark canvas; the light value already passes. */ +/* base-600 is about 3.2:1 on the dark canvas; the light value already passes. */ html.high-contrast.dark .ProseMirror p.is-editor-empty:first-child::before { color: var(--color-base-500); } @@ -554,7 +552,7 @@ html.high-contrast.dark .ProseMirror p.is-editor-empty:first-child::before { .tiptap .suggestion.is-empty::after { content: '\00A0'; - border-bottom: 1px dotted rgba(31, 41, 55, 0.12); + border-bottom: 1px dotted color-mix(in oklab, var(--color-base-800) 12%, transparent); } .input-prose .tiptap ul[data-type='taskList'] { @@ -625,13 +623,13 @@ html.high-contrast.dark .ProseMirror p.is-editor-empty:first-child::before { @media (prefers-color-scheme: dark) { .ProseMirror p.is-editor-empty:first-child::before { - color: #757575; + color: var(--color-base-600); } } .ProseMirror p.is-editor-empty.ai-autocompletion:first-child::before { content: attr(data-suggestion); - color: #a0a0a0; + color: var(--color-base-500); } .ProseMirror p.is-editor-empty.ai-autocompletion:first-child::after { @@ -639,7 +637,7 @@ html.high-contrast.dark .ProseMirror p.is-editor-empty:first-child::before { } .ai-autocompletion::after { - color: #a0a0a0; + color: var(--color-base-500); content: attr(data-suggestion); pointer-events: none; @@ -696,7 +694,7 @@ html.high-contrast.dark .ProseMirror p.is-editor-empty:first-child::before { } .tiptap td { - @apply text-base-900 dark:text-white w-max; + @apply text-base-900 dark:text-base-0 w-max; } .tiptap tr { @@ -852,13 +850,13 @@ html.high-contrast.dark .ProseMirror p.is-editor-empty:first-child::before { } body { - background: #fff; - color: #000; + background: var(--color-base-0); + color: var(--color-base-1000); } .dark body { - background: #171717; - color: #eee; + background: var(--color-base-900); + color: var(--color-base-100); } /* Position the handle relative to each LI */ @@ -903,7 +901,7 @@ body { opacity: 1; } .pm-list-drag-handle:hover { - background: rgba(0, 0, 0, 0.06); + background: color-mix(in oklab, var(--color-base-1000) 6%, transparent); } :root { @@ -1004,7 +1002,7 @@ body { .dark\:hover\:text-base-300:hover, .dark\:hover\:text-base-400:hover ) { - color: #fff; + color: var(--color-base-0); } /* Elements that hover to a lighter grey than the new resting colour. */ @@ -1091,7 +1089,7 @@ html.high-contrast.dark .dark\:group-hover\:text-base-300, .dark\:group-hover\:text-base-400 ) { - color: #fff; + color: var(--color-base-0); } } @@ -1115,7 +1113,7 @@ html.high-contrast:not(.dark) .shimmer::after { font-size: 0.875rem; line-height: 1.6; color: var(--color-base-800); - background: #fff; + background: var(--color-base-0); border-radius: 0.25rem; } .dark .office-preview { @@ -1193,10 +1191,10 @@ html.high-contrast:not(.dark) .shimmer::after { } /* Row hover and selection */ .office-preview table tbody tr:nth-child(even) td:not(.excel-row-num) { - background: rgba(0, 0, 0, 0.015); + background: color-mix(in oklab, var(--color-base-1000) 1.5%, transparent); } .dark .office-preview table tbody tr:nth-child(even) td:not(.excel-row-num) { - background: rgba(255, 255, 255, 0.02); + background: color-mix(in oklab, var(--color-base-0) 2%, transparent); } .office-preview table tbody tr:hover td:not(.excel-row-num) { background: rgba(59, 130, 246, 0.06); diff --git a/src/app.html b/src/app.html index a1aea80658..32073fd973 100644 --- a/src/app.html +++ b/src/app.html @@ -78,6 +78,26 @@ metaThemeColorTag.setAttribute('content', '#171717'); } + // User theme colours; keep in sync with applyThemeColors in $lib/utils/theme. + const applyThemeColors = () => { + const root = document.documentElement; + let colors; + try { + colors = JSON.parse(localStorage.themeColors ?? '{}')[ + root.classList.contains('dark') ? 'dark' : 'light' + ]; + } catch {} + if (colors && !root.classList.contains('her')) { + root.style.setProperty('--app-bg', colors.bg); + root.style.setProperty('--app-fg', colors.fg); + metaThemeColorTag.setAttribute('content', colors.bg); + } else { + root.style.removeProperty('--app-bg'); + root.style.removeProperty('--app-fg'); + } + }; + applyThemeColors(); + // LICENSE covers these Open WebUI splash logo assets. // Do not alter, remove, obscure, or replace them except as LICENSE permits: // https://docs.openwebui.com/license. @@ -102,6 +122,7 @@ document.documentElement.classList.remove('dark'); metaThemeColorTag.setAttribute('content', '#ffffff'); } + applyThemeColors(); } }); const isDarkMode = document.documentElement.classList.contains('dark'); diff --git a/src/lib/components/AddConnectionModal.svelte b/src/lib/components/AddConnectionModal.svelte index 736b932134..d7ebd50a13 100644 --- a/src/lib/components/AddConnectionModal.svelte +++ b/src/lib/components/AddConnectionModal.svelte @@ -830,7 +830,7 @@ diff --git a/src/lib/components/admin/Settings/Pipelines.svelte b/src/lib/components/admin/Settings/Pipelines.svelte index 5e89c54dec..0abc61220b 100644 --- a/src/lib/components/admin/Settings/Pipelines.svelte +++ b/src/lib/components/admin/Settings/Pipelines.svelte @@ -52,9 +52,9 @@ let pipelineDownloadUrl = ''; const inputClass = - 'w-full h-7 rounded-lg border border-base-100/50 bg-base-50/40 px-2 text-xs text-base-700 outline-hidden transition-colors placeholder:text-base-300 focus:border-blue-400 dark:border-white/[0.04] dark:bg-white/[0.03] dark:text-base-300 dark:placeholder:text-base-700 dark:focus:border-blue-500'; + 'w-full h-7 rounded-lg border border-base-100/50 bg-base-50/40 px-2 text-xs text-base-700 outline-hidden transition-colors placeholder:text-base-300 focus:border-blue-400 dark:border-base-0/[0.04] dark:bg-base-0/[0.03] dark:text-base-300 dark:placeholder:text-base-700 dark:focus:border-blue-500'; const actionButtonClass = - 'shrink-0 text-xs text-base-500 transition-colors hover:text-base-900 disabled:opacity-50 dark:text-base-500 dark:hover:text-white'; + 'shrink-0 text-xs text-base-500 transition-colors hover:text-base-900 disabled:opacity-50 dark:text-base-500 dark:hover:text-base-0'; const mutedMessageClass = 'text-xs text-base-400 dark:text-base-600'; const updateHandler = async () => { @@ -239,7 +239,7 @@ updateHandler(); }} > -

+

{$i18n.t('settings.admin.pipelines.title')}

@@ -291,7 +291,7 @@ >
@@ -229,7 +229,7 @@ bind:value={systemPrompt} rows="4" placeholder={$i18n.t('You are a sub-agent...')} - class="mt-1 w-full resize-y rounded-lg border border-base-100/50 bg-base-50/40 px-2 py-1.5 font-mono text-xs text-base-700 outline-hidden transition-colors focus:border-blue-400 dark:border-white/[0.04] dark:bg-white/[0.03] dark:text-base-300 dark:focus:border-blue-500" + class="mt-1 w-full resize-y rounded-lg border border-base-100/50 bg-base-50/40 px-2 py-1.5 font-mono text-xs text-base-700 outline-hidden transition-colors focus:border-blue-400 dark:border-base-0/[0.04] dark:bg-base-0/[0.03] dark:text-base-300 dark:focus:border-blue-500" >

{$i18n.t('settings.admin.subagents.systemPrompt.description')} diff --git a/src/lib/components/admin/Settings/Videos.svelte b/src/lib/components/admin/Settings/Videos.svelte index 67bb6eee5e..8453ab95d9 100644 --- a/src/lib/components/admin/Settings/Videos.svelte +++ b/src/lib/components/admin/Settings/Videos.svelte @@ -122,7 +122,7 @@ {/if} {#if reply?.actions?.length} @@ -78,7 +78,7 @@ href={item.url} target="_blank" rel="noopener noreferrer" - class="focus-ring inline-flex min-h-7 max-w-full items-center rounded-lg border border-base-200 px-2.5 text-xs hover:bg-base-100 dark:border-white/8 dark:hover:bg-base-850" + class="focus-ring inline-flex min-h-7 max-w-full items-center rounded-lg border border-base-200 px-2.5 text-xs hover:bg-base-100 dark:border-base-0/8 dark:hover:bg-base-850" >{item.label} {:else if item.action_id} @@ -87,7 +87,7 @@ disabled={busy} class="focus-ring flex h-7 max-w-full shrink-0 items-center justify-center gap-1.5 rounded-lg px-2.5 text-xs font-normal transition disabled:cursor-not-allowed disabled:opacity-60 {index === 0 - ? 'bg-base-900 text-white hover:bg-black dark:bg-base-100 dark:text-base-900 dark:hover:bg-white' + ? 'bg-base-900 text-base-0 hover:bg-base-1000 dark:bg-base-100 dark:text-base-900 dark:hover:bg-base-0' : 'hover:bg-base-100 dark:hover:bg-base-850'}" on:click={() => item.action_id && action(item.action_id)}>{item.label} diff --git a/src/lib/components/channel/AppEmbed.svelte b/src/lib/components/channel/AppEmbed.svelte index c840d07d19..a0173d6e6f 100644 --- a/src/lib/components/channel/AppEmbed.svelte +++ b/src/lib/components/channel/AppEmbed.svelte @@ -9,7 +9,7 @@

{#if accent}
@@ -242,7 +242,7 @@ >
- {typingMembers.map((member) => member.name).join(', ')} {typingMembers.length === 1 ? $i18n.t('is typing...') : $i18n.t('are typing...')} @@ -251,7 +251,7 @@ {/if}
@@ -341,7 +341,7 @@ {#each state.members as member (member.identity.participation)}
(verified = new Set([...verified, member.fingerprint]))} >{$i18n.t('Codes match')} @@ -381,7 +381,7 @@
diff --git a/src/lib/components/channel/MessageInput.svelte b/src/lib/components/channel/MessageInput.svelte index 752c3b003d..e402737452 100644 --- a/src/lib/components/channel/MessageInput.svelte +++ b/src/lib/components/channel/MessageInput.svelte @@ -95,7 +95,7 @@ export let replyToMessage: any = null; - export let typingUsersClassName = 'from-white dark:from-base-900'; + export let typingUsersClassName = 'from-base-0 dark:from-base-900'; let loaded = false; let draggedOver = false; @@ -913,7 +913,7 @@ >
diff --git a/src/lib/components/channel/Thread.svelte b/src/lib/components/channel/Thread.svelte index e7971f699c..9fde5f39d0 100644 --- a/src/lib/components/channel/Thread.svelte +++ b/src/lib/components/channel/Thread.svelte @@ -225,7 +225,7 @@ {#if channel} -
+
{$i18n.t('Thread')}
@@ -311,7 +311,7 @@ placeholder={!channel?.write_access ? $i18n.t('You do not have permission to send messages in this thread.') : $i18n.t('Reply to thread...')} - typingUsersClassName="from-white dark:from-base-900" + typingUsersClassName="from-base-0 dark:from-base-900" {typingUsers} userSuggestions={true} channelSuggestions={true} diff --git a/src/lib/components/channel/WebhookItem.svelte b/src/lib/components/channel/WebhookItem.svelte index 663751c85b..9de11801e5 100644 --- a/src/lib/components/channel/WebhookItem.svelte +++ b/src/lib/components/channel/WebhookItem.svelte @@ -104,7 +104,7 @@ alt="" />
-
+
{name}
diff --git a/src/lib/components/channel/WebhooksModal.svelte b/src/lib/components/channel/WebhooksModal.svelte index b00cbfdb61..697ace722e 100644 --- a/src/lib/components/channel/WebhooksModal.svelte +++ b/src/lib/components/channel/WebhooksModal.svelte @@ -108,7 +108,7 @@ {#if data.mode !== 'url' && supported} {/if} diff --git a/src/lib/components/chat/EmbeddedChatHistoryDropdown.svelte b/src/lib/components/chat/EmbeddedChatHistoryDropdown.svelte index 2bc404795f..e7bd09787f 100644 --- a/src/lib/components/chat/EmbeddedChatHistoryDropdown.svelte +++ b/src/lib/components/chat/EmbeddedChatHistoryDropdown.svelte @@ -37,7 +37,7 @@ > @@ -2902,7 +2902,7 @@
{#each filenameMatches as match (match.path)}
@@ -3276,7 +3276,7 @@
-
+
{#each [original, revised] as path}
{name(path)}
@@ -225,7 +225,7 @@
{:else if result}
{#each result.hunks as hunk}
{hunk.header}
diff --git a/src/lib/components/chat/FileNav/FileComparisonModal.svelte b/src/lib/components/chat/FileNav/FileComparisonModal.svelte index 9e85190f20..626eaeb3cb 100644 --- a/src/lib/components/chat/FileNav/FileComparisonModal.svelte +++ b/src/lib/components/chat/FileNav/FileComparisonModal.svelte @@ -118,7 +118,7 @@ ariaLabel={$i18n.t('Compare files')} size="full" containerClassName="p-2 sm:p-4" - className="h-[calc(100dvh-2rem)] overflow-hidden rounded-2xl bg-white dark:bg-base-900 !border-0" + className="h-[calc(100dvh-2rem)] overflow-hidden rounded-2xl bg-base-0 dark:bg-base-900 !border-0" onRequestClose={close} > @@ -137,7 +137,7 @@

{$i18n.t('Compare files')}

@@ -147,7 +147,7 @@

{file.name}

diff --git a/src/lib/components/chat/FileNav/FileEntryRow.svelte b/src/lib/components/chat/FileNav/FileEntryRow.svelte index 213eb79242..1af6c5646a 100644 --- a/src/lib/components/chat/FileNav/FileEntryRow.svelte +++ b/src/lib/components/chat/FileNav/FileEntryRow.svelte @@ -137,7 +137,7 @@ $: menuItemClass = variant === 'workspace' ? 'select-none flex h-[1.6875rem] w-full cursor-pointer items-center gap-2 rounded-xl bg-transparent px-2 text-xs hover:text-base-900 dark:hover:text-base-100' - : 'select-none flex h-7 w-full items-center gap-2 rounded-lg px-2 text-xs hover:bg-base-50/40 dark:hover:bg-white/4 transition'; + : 'select-none flex h-7 w-full items-center gap-2 rounded-lg px-2 text-xs hover:bg-base-50/40 dark:hover:bg-base-0/4 transition'; $: rowIndent = `${8 + depth * 16}px`; const fitGridName = (node: HTMLElement, name: string) => { const fit = () => { @@ -468,10 +468,10 @@ {selected || active ? viewMode === 'grid' ? 'bg-blue-50 dark:bg-blue-500/15' - : 'bg-base-100 dark:bg-white/8' + : 'bg-base-100 dark:bg-base-0/8' : viewMode === 'grid' ? '' - : 'hover:bg-base-100 dark:hover:bg-white/10'} + : 'hover:bg-base-100 dark:hover:bg-base-0/10'} {dragOverFolder ? 'bg-blue-50 dark:bg-blue-500/15 ring-2 ring-blue-500/60 ring-inset' : ''}" role="presentation" on:dragover={(e) => { @@ -748,7 +748,7 @@ ? 'h-6 w-6' : 'h-5 w-5'} items-center justify-center mr-1 rounded transition text-base-400 hover:text-base-600 dark:text-base-500 dark:hover:text-base-400 - hover:bg-base-50/40 dark:hover:bg-white/4 {viewMode === 'grid' + hover:bg-base-50/40 dark:hover:bg-base-0/4 {viewMode === 'grid' ? 'absolute left-[calc(50%_+_16px)] -top-[3px] !m-0 !h-6 !w-6 opacity-0 group-hover:opacity-100 group-focus-within:opacity-100 max-md:opacity-100' : ''}" style:opacity={viewMode === 'grid' && menuOpen ? 1 : undefined} @@ -790,7 +790,7 @@ {/if} {#if entry.type === 'directory' && (onNewFolder || onNewFile)} - + {/if} {#if variant !== 'workspace' || entry.type !== 'directory'} {#if viewMode !== null} - + {#each ['grid', 'list'] as mode} {/if} {#if preview && ['html', 'svg'].includes(lang) && $visibleControls['chat.code_preview']} diff --git a/src/lib/components/chat/Messages/MultiResponseMessages.svelte b/src/lib/components/chat/Messages/MultiResponseMessages.svelte index 6a3c867551..aac8a4cd47 100644 --- a/src/lib/components/chat/Messages/MultiResponseMessages.svelte +++ b/src/lib/components/chat/Messages/MultiResponseMessages.svelte @@ -454,7 +454,7 @@ id="merge-response-button" class="{true ? 'visible' - : 'hover-reveal'} p-1 hover:bg-black/5 dark:hover:bg-white/5 rounded-lg dark:hover:text-white hover:text-black transition" + : 'hover-reveal'} p-1 hover:bg-base-1000/5 dark:hover:bg-base-0/5 rounded-lg dark:hover:text-base-0 hover:text-base-1000 transition" on:click={() => { mergeResponsesHandler(); }} diff --git a/src/lib/components/chat/Messages/RateComment.svelte b/src/lib/components/chat/Messages/RateComment.svelte index aeb09cb682..ef910d5e6b 100644 --- a/src/lib/components/chat/Messages/RateComment.svelte +++ b/src/lib/components/chat/Messages/RateComment.svelte @@ -148,7 +148,7 @@ class="aspect-square w-full text-sm border border-base-100/30 dark:border-base-850/30 hover:bg-base-50 dark:hover:bg-base-850 {detailedRating === rating ? 'bg-base-100 dark:bg-base-800' - : ''} transition rounded-full disabled:cursor-not-allowed disabled:text-base-500 disabled:bg-white dark:disabled:bg-base-900" + : ''} transition rounded-full disabled:cursor-not-allowed disabled:text-base-500 disabled:bg-base-0 dark:disabled:bg-base-900" on:click={() => { detailedRating = rating; }} @@ -252,7 +252,7 @@
{#if expanded}
{content}
diff --git a/src/lib/components/chat/Messages/ToolOutputFile.svelte b/src/lib/components/chat/Messages/ToolOutputFile.svelte index 55d3d92edc..28adb1e22a 100644 --- a/src/lib/components/chat/Messages/ToolOutputFile.svelte +++ b/src/lib/components/chat/Messages/ToolOutputFile.svelte @@ -230,10 +230,10 @@
{#if timerExpanded}
{message.content} @@ -503,7 +503,7 @@
@@ -290,7 +290,7 @@
+ {/if} + {#each [{ key: 'bg', label: $i18n.t('settings.personal.general.themeColors.background') }, { key: 'fg', label: $i18n.t('settings.personal.general.themeColors.text') }] as item (item.key)} + setModeColor(item.key, e.currentTarget.value)} + /> + {/each} +
+ + {/if} +
@@ -416,7 +416,7 @@ bind:show={formOpen} >
-

+

{editingId ? $i18n.t('Edit') : $i18n.t('settings.personal.notifications.addNotificationTarget.label')} @@ -464,7 +464,7 @@ class="h-6 rounded-md px-2 text-[0.6875rem] transition-colors {form.events.includes( event.event ) - ? 'bg-base-200/60 text-base-900 dark:bg-white/10 dark:text-white' + ? 'bg-base-200/60 text-base-900 dark:bg-base-0/10 dark:text-base-0' : 'text-base-500 hover:text-base-800 dark:hover:text-base-300'}" type="button" on:click={() => toggleFormEvent(event.event)} @@ -482,7 +482,7 @@ {#each ['away', 'always'] as mode}
@@ -443,7 +443,7 @@ bind:this={iframe} src={frameUrl} title={$i18n.t('Browser')} - class="block h-full w-full border-0 bg-white" + class="block h-full w-full border-0 bg-base-0" sandbox="allow-scripts{!session && ($settings?.terminalPreviewAllowSameOrigin ?? false) ? ' allow-same-origin' : ''} allow-forms allow-popups allow-modals allow-downloads" diff --git a/src/lib/components/chat/Tabs/Desktop.svelte b/src/lib/components/chat/Tabs/Desktop.svelte index cd9c46bcf1..5e54234d4d 100644 --- a/src/lib/components/chat/Tabs/Desktop.svelte +++ b/src/lib/components/chat/Tabs/Desktop.svelte @@ -174,7 +174,7 @@ -
+
{/if} {#if expanded}
{#each ['changes', 'history', ...(github?.available ? [...(github.issues ? ['issues'] : []), 'pull requests'] : [])] as section} @@ -861,7 +861,7 @@ {#each ['unified', 'split'] as mode}
@@ -1092,7 +1092,7 @@
{/if}
act('commit', { message: [summary.trim(), description.trim()].filter(Boolean).join('\n\n') @@ -1100,13 +1100,13 @@ >
{#if selected.comments?.length}
{$i18n.t('Comments')}
{#each selected.comments as item, index}
{#if onDraft && item.body?.trim()}{/if} @@ -468,11 +468,11 @@
{/each}{/if}
mutate('comment')} > {#if creating}
{/if}
{#if creating}{/if} @@ -529,12 +529,12 @@ {:else if selected}
{#each tabs as tab}{/each} @@ -605,7 +605,7 @@
{/if}
{#if selected.state === 'OPEN'}
{#if selected.isDraft}{/if} {#each activity as item, index}
{#if onDraft && item.body?.trim()}{/if} @@ -729,11 +729,11 @@
{/if}
mutate('comment')} >