mirror of https://github.com/luizdepra/hugo-coder.git

Alphonse Mariya
26.22.2021 a4fb372e6be35acdb28acf609f5a5807deae7946
Set color-scheme property of :root element (#632)

By setting the color-scheme property of the :root element we get
matching (dark or light) scrollbars and form controls.

see: https://developer.mozilla.org/en-US/docs/Web/CSS/color-scheme
1 files modified
1 ■■■■ changed files
assets/js/coder.js 1 ●●●● patch | view | raw | blame | history
assets/js/coder.js
@@ -33,6 +33,7 @@
    let inverse = theme === 'dark' ? 'light' : 'dark';
    body.classList.remove('colorscheme-' + inverse);
    body.classList.add('colorscheme-' + theme);
    document.documentElement.style['color-scheme'] = theme;
}
function rememberTheme(theme) {