[WebProfilerBundle] Select default theme based on user preferences
This commit is contained in:
parent
482c357104
commit
0fc0a348b8
@ -14,8 +14,11 @@
|
||||
{% endblock %}
|
||||
</head>
|
||||
<body>
|
||||
<script async>
|
||||
document.body.classList.add(localStorage.getItem('symfony/profiler/theme') || 'theme-light', localStorage.getItem('symfony/profiler/width') || 'width-normal');
|
||||
<script>
|
||||
document.body.classList.add(
|
||||
localStorage.getItem('symfony/profiler/theme') || (matchMedia('(prefers-color-scheme: dark)').matches ? 'theme-dark' : 'theme-light'),
|
||||
localStorage.getItem('symfony/profiler/width') || 'width-normal'
|
||||
);
|
||||
</script>
|
||||
|
||||
{% block body '' %}
|
||||
|
Reference in New Issue
Block a user