This commit is contained in:
MuslemRahimi 2025-03-12 20:39:18 +01:00
parent dac08ce02a
commit d1fb438b1a
4 changed files with 3 additions and 13 deletions

View File

@ -33,16 +33,7 @@ export const handle = sequence(async ({ event, resolve }) => {
} }
} }
const theme = event.cookies.get("theme-mode") || "light"; const response = await resolve(event);
// Process request with theme injection
const response = await resolve(event, {
transformPageChunk: ({ html }) => {
// Inject theme class into HTML element
return html.replace('<html', `<html data-theme="${theme}"`);
}
});
// Use a more compatible way to set the cookie // Use a more compatible way to set the cookie
const cookieString = event?.locals?.pb?.authStore?.exportToCookie({ const cookieString = event?.locals?.pb?.authStore?.exportToCookie({

View File

@ -279,7 +279,7 @@
} }
</script> </script>
<div class="hidden sm:block w-full sm:max-w-[600px]"> <div class="hidden sm:block w-full sm:max-w-[600px] shadow-sm">
<div> <div>
<div class="relative flex items-center"> <div class="relative flex items-center">
<div class="absolute inset-y-0 left-0 flex items-center pl-2.5"> <div class="absolute inset-y-0 left-0 flex items-center pl-2.5">

View File

@ -125,7 +125,6 @@
typeof data?.cookieConsent !== "undefined" ? false : true; typeof data?.cookieConsent !== "undefined" ? false : true;
onMount(async () => { onMount(async () => {
setMode(data.themeMode);
if (data?.user?.id) { if (data?.user?.id) {
await loadWorker(); await loadWorker();
/* /*

View File

@ -1381,7 +1381,7 @@
on:click={() => { on:click={() => {
handleChangeValue(newValue); handleChangeValue(newValue);
}} }}
class="block w-full bg-white dark:bg-default border-b border-gray-300 dark:border-gray-600 px-4 py-1.5 text-left text-sm sm:text-[1rem] rounded last:border-0 sm:hover:bg-gray-100 focus:bg-blue-100 focus:text-gray-900 focus:outline-hidden" class="block w-full cursor-pointer border-b border-gray-300 dark:border-gray-600 px-4 py-1.5 text-left text-sm sm:text-[1rem] rounded last:border-0 focus:bg-blue-100 focus:text-gray-900 focus:outline-hidden"
> >
{ruleCondition[row?.rule] {ruleCondition[row?.rule]
?.replace("under", "Under") ?.replace("under", "Under")