Handle noscript style with "js" class on <html>
.
This commit is contained in:
parent
ca5c6f6c26
commit
ac764df8ab
@ -24,7 +24,6 @@ Otherwise, have a great day =^.^=
|
|||||||
<link id="styleNight" rel="stylesheet" href="https://rust-lang.github.io/mdBook/tomorrow-night.css" disabled="true"> {# #}
|
<link id="styleNight" rel="stylesheet" href="https://rust-lang.github.io/mdBook/tomorrow-night.css" disabled="true"> {# #}
|
||||||
<link id="styleAyu" rel="stylesheet" href="https://rust-lang.github.io/mdBook/ayu-highlight.css" disabled="true"> {# #}
|
<link id="styleAyu" rel="stylesheet" href="https://rust-lang.github.io/mdBook/ayu-highlight.css" disabled="true"> {# #}
|
||||||
<link rel="stylesheet" href="style.css"> {# #}
|
<link rel="stylesheet" href="style.css"> {# #}
|
||||||
<noscript><link rel="stylesheet" href="noscript.css"></noscript> {# #}
|
|
||||||
</head> {# #}
|
</head> {# #}
|
||||||
<body> {# #}
|
<body> {# #}
|
||||||
<script src="theme.js"></script> {# #}
|
<script src="theme.js"></script> {# #}
|
||||||
|
@ -1,3 +0,0 @@
|
|||||||
#settings-dropdown, #menu-filters {
|
|
||||||
display: none;
|
|
||||||
}
|
|
@ -230,6 +230,11 @@ details[open] {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
html:not(.js) #settings-dropdown,
|
||||||
|
html:not(.js)#menu-filters {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
#settings-dropdown {
|
#settings-dropdown {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
margin: 0.7em;
|
margin: 0.7em;
|
||||||
|
@ -45,6 +45,10 @@ function setTheme(theme, store) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
|
// This file is loaded first. If so, we add the `js` class on the `<html>`
|
||||||
|
// element.
|
||||||
|
document.documentElement.classList.add("js");
|
||||||
|
|
||||||
// loading the theme after the initial load
|
// loading the theme after the initial load
|
||||||
const prefersDark = window.matchMedia("(prefers-color-scheme: dark)");
|
const prefersDark = window.matchMedia("(prefers-color-scheme: dark)");
|
||||||
const theme = loadValue("theme");
|
const theme = loadValue("theme");
|
||||||
|
Loading…
Reference in New Issue
Block a user