Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion examples/api/index.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<!doctype html>
<html lang="en" theme="dark">
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="color-scheme" content="dark light" />
<title>API Example App</title>
</head>

Expand Down
12 changes: 8 additions & 4 deletions examples/api/src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,13 @@

function applyTheme() {
const isDark = theme === 'auto' ? preferDark.current : theme === 'dark'
isDark
? document.documentElement.classList.add('dark')
: document.documentElement.classList.remove('dark')
if (isDark) {
document.documentElement.classList.add('dark')
document.documentElement.classList.remove('light')
} else {
document.documentElement.classList.remove('dark')
document.documentElement.classList.add('light')
}
setTheme(theme === 'auto' ? null : theme)
localStorage.setItem('theme', theme)
}
Expand Down Expand Up @@ -240,7 +244,7 @@
id="sidebarToggle"
bind:this={sidebarToggle}
class="z-2000 hidden lt-sm:flex justify-center absolute items-center w-8 h-8 rd-8
bg-accent dark:bg-darkAccent active:bg-accentDark dark:active:bg-darkAccentDark"
bg-accent dark:bg-darkAccent active:bg-accentDark dark:active:bg-darkAccentDark text-accentText dark:text-darkAccentText"
>
{#if isSideBarOpen}
<span class="i-codicon-close animate-duration-300ms animate-fade-in"></span>
Expand Down
7 changes: 7 additions & 0 deletions examples/api/src/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
line-height: 1.5;
}

:root.dark {
color-scheme: dark;
}
:root.light {
color-scheme: light;
}

input,
select {
min-width: 0;
Expand Down
Loading