Skip to content

Commit 472b75c

Browse files
authored
feat(ThemeSwitcher): update color-scheme in applyTheme (#1394)
Signed-off-by: Kim Anh Nguyen <4783194+kimanhou@users.noreply.github.com>
1 parent 0cdf766 commit 472b75c

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/components/ThemeSwitcher/ThemeSwitcher.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,10 @@ export const isDarkTheme = (theme: string) => {
2929
export const applyTheme = (theme: string): void => {
3030
if (isDarkTheme(theme)) {
3131
document.body.classList.add("is-dark");
32+
document.documentElement.style.colorScheme = "dark";
3233
} else {
3334
document.body.classList.remove("is-dark");
35+
document.documentElement.style.colorScheme = "light";
3436
}
3537
};
3638

0 commit comments

Comments
 (0)