Skip to content

Commit da7798c

Browse files
committed
Default dark theme
1 parent b5ea8d8 commit da7798c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ux.symfony.com/templates/base.html.twig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<meta charset="UTF-8">
55
<title>{% block title %}{{ meta.title|default }}{{ meta.title_suffix|default(' - Symfony UX') }}{% endblock %}</title>
66
<meta name="viewport" content="width=device-width, initial-scale=1">
7-
<meta name="color-scheme" content="light dark">
7+
<meta name="color-scheme" content="dark light">
88
{% block stylesheets %}
99
{% endblock %}
1010
{% if meta.canonical|default %}
@@ -25,8 +25,8 @@
2525
<meta property="og:image:type" content="image/png">
2626
{% block javascripts %}
2727
<script>
28-
const theme = localStorage.getItem('user-theme') || (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
29-
document.documentElement.setAttribute('data-bs-theme', theme === 'dark' ? 'dark' : 'light');
28+
const theme = localStorage.getItem('user-theme') || (window.matchMedia('(prefers-color-scheme: light)').matches ? 'light' : 'dark');
29+
document.documentElement.setAttribute('data-bs-theme', theme === 'light' ? 'light' : 'dark');
3030
</script>
3131
{% block importmap %}
3232
<script>

0 commit comments

Comments
 (0)