feat: dark mode
This commit is contained in:
parent
579dd239e7
commit
7931009e90
1 changed files with 8 additions and 0 deletions
|
@ -14,5 +14,13 @@
|
|||
<div class="container">
|
||||
<%= EEx.eval_file(embedded_template, embedded_args) %>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
if (window.matchMedia('(prefers-color-scheme: dark)').matches) {
|
||||
document.documentElement.setAttribute('data-bs-theme', 'dark')
|
||||
} else {
|
||||
document.documentElement.setAttribute('data-bs-theme', 'light')
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
Reference in a new issue