diff --git a/src/html/index.html.template b/src/html/index.html.template
index fe4271c0fb..5ec5dd1dc1 100644
--- a/src/html/index.html.template
+++ b/src/html/index.html.template
@@ -48,7 +48,7 @@
}
@media (prefers-color-scheme: dark) {
html {
- background-color: #111111;
+ background-color: var(--primary-background-color, #111111);
}
#ha-init-skeleton::before {
background-color: #1c1c1c;