mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-16 10:51:06 +00:00
docs(style): correctly set carbon theme
This commit is contained in:
parent
9fac25dc10
commit
196b1bac2f
6 changed files with 7 additions and 7 deletions
|
@ -1,5 +1,5 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en" theme="white">
|
||||
<html lang="en" data-carbon-theme="white">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="icon" href="/favicon.ico" />
|
||||
|
@ -10,7 +10,7 @@
|
|||
const theme = localStorage.getItem("theme");
|
||||
|
||||
if (["white", "g10", "g90", "g100"].includes(theme)) {
|
||||
document.documentElement.setAttribute("theme", theme);
|
||||
document.documentElement.setAttribute("data-carbon-theme", theme);
|
||||
document.documentElement.style.setProperty("color-scheme", ["white", "g10"].includes(theme) ? "light" : "dark");
|
||||
}
|
||||
} catch (e) {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue