Skip to content

Commit f31c70b

Browse files
authored
fix(core): apply color scheme according to media rather than classname (#149)
1 parent 07200ec commit f31c70b

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

packages/core/src/client/standalone/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<title>Vite DevTools</title>
77
<meta name="description" content="Vite DevTools" />
88
</head>
9-
<body class="font-sans dark:text-white dark:bg-black">
9+
<body class="font-sans">
1010
<div id="app"></div>
1111
<script type="module" src="./main.ts"></script>
1212
</body>

packages/core/src/client/standalone/styles/main.css

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ body,
66
padding: 0;
77
}
88

9-
html.dark {
10-
color-scheme: dark;
9+
@media (prefers-color-scheme: dark) {
10+
html {
11+
color-scheme: dark;
12+
}
1113
}

0 commit comments

Comments
 (0)