window.matchMedia('(prefers-color-scheme: dark)')
.addEventListener('change', event => {
if (event.matches) {
jtd.setTheme('dark');
} else {
jtd.setTheme('light');
}
});
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
jtd.setTheme('dark');
}cloudflare/pint
Publicmirrored from https://github.com/cloudflare/pintAvailable
docs/_includes/js/custom.js
12lines · modepreview