9 lines
351 B
Text
9 lines
351 B
Text
|
:javascript
|
||
|
function setDarkBeforeRender() {
|
||
|
const localScheme = localStorage.getItem('scheme')
|
||
|
if (localScheme == 'dark' || (localScheme == 'system' && window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches)) {
|
||
|
document.documentElement.setAttribute('data-fr-theme', 'dark');
|
||
|
}
|
||
|
}
|
||
|
setDarkBeforeRender();
|