-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
views/index: respond to system colour scheme
- Loading branch information
Showing
1 changed file
with
9 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,9 +9,17 @@ | |
<link rel="icon" type="image/x-icon" href="https://brew.sh/assets/img/favicon.ico" sizes="16x16"> | ||
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous"> | ||
<script defer src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js" integrity="sha384-BBtl+eGJRgqQAUMxJ7pMwbEyER4l1g+O15P+16Ep7Q9Q+zqX6gSbd85u4mG4QzX+" crossorigin="anonymous"></script> | ||
<script> | ||
const darkSchemeMedia = window.matchMedia("(prefers-color-scheme: dark)"); | ||
function updateTheme(mediaQuery) { | ||
document.documentElement.dataset.bsTheme = mediaQuery.matches ? "dark" : "light"; | ||
} | ||
updateTheme(darkSchemeMedia); | ||
darkSchemeMedia.addEventListener("change", updateTheme); | ||
</script> | ||
</head> | ||
<body> | ||
<nav class="navbar navbar-expand navbar-light bg-light"> | ||
<nav class="navbar navbar-expand bg-body-tertiary"> | ||
<div class="container-xxl flex-wrap"> | ||
<div class="navbar-brand"> | ||
<img src="https://brew.sh/assets/img/brewtestbot.svg" alt="" width="48" height="48" class="d-inline-block me-1"> | ||
|