feat: remake theme handling
This commit is contained in:
1 parent
18d2e8fc1e
commit
3aa948891a
10 files changed
+413
-249
No files matched your search
@@ -4,7 +4,7 @@
|
||||
top: boolean | null
|
||||
noGap: boolean | null
|
||||
},
|
||||
screenWidth: number,
|
||||
screenWidth: number
|
||||
): {
|
||||
noGap: boolean
|
||||
top: boolean
|
||||
@@ -35,7 +35,7 @@
|
||||
export const calculatePadding = (
|
||||
panel: boolean,
|
||||
top: boolean,
|
||||
content: boolean,
|
||||
content: boolean
|
||||
): {
|
||||
top: number
|
||||
class: string
|
||||
@@ -62,13 +62,13 @@
|
||||
})
|
||||
export let contentPadding: Readable<ReturnType<typeof calculatePadding>> =
|
||||
derived(dockProps, ($dockProps, set) =>
|
||||
set(calculatePadding($dockProps.noGap, $dockProps.top, true)),
|
||||
set(calculatePadding($dockProps.noGap, $dockProps.top, true))
|
||||
)
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
import { userSettings } from '$lib/settings.js'
|
||||
import { colors, colorsToVars } from '$lib/ui/colors'
|
||||
import { themeVars } from '$lib/ui/colors'
|
||||
import { routes } from '$lib/util.js'
|
||||
import { derived, writable, type Readable, type Writable } from 'svelte/store'
|
||||
|
||||
@@ -82,11 +82,7 @@
|
||||
|
||||
<svelte:window bind:innerWidth={$screenWidth} />
|
||||
|
||||
<div
|
||||
{...$$restProps}
|
||||
class="shell {$$props.class}"
|
||||
style={colorsToVars($colors)}
|
||||
>
|
||||
<div {...$$restProps} class="shell {$$props.class}" style={$themeVars}>
|
||||
<slot />
|
||||
<div
|
||||
class="
|
||||
@@ -112,7 +108,7 @@
|
||||
pointer-events-auto {topPanel
|
||||
? 'bg-slate-50 dark:bg-zinc-950 border-slate-100 dark:border-zinc-900'
|
||||
: `border-slate-200 dark:border-zinc-800 shadow-2xl backdrop-blur-xl
|
||||
dark:backdrop-brightness-[25%] bg-[#ffffff]/75`}"
|
||||
bg-white/50 dark:bg-zinc-925/70`}"
|
||||
{title}
|
||||
style="transition: border-radius 250ms;"
|
||||
/>
|
||||
|
||||
Reference in new issue
Block a user