@intergrav/dev.css 4.3.0 → 4.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/* responsive-sidebar for dev.css v4, a lightweight CSS framework - https://github.com/intergrav/dev.css */
|
|
2
|
-
/* about: auto open/close `aside
|
|
2
|
+
/* about: auto open/close `aside details` at 82rem breakpoint. prevents sidebar from looking awkward on wide screens, improves usability on small screens */
|
|
3
3
|
|
|
4
4
|
const mediaQuery = matchMedia("(min-width: 82rem)");
|
|
5
5
|
const toggleDetails = (matches) =>
|
|
6
6
|
document
|
|
7
|
-
.querySelectorAll("aside
|
|
7
|
+
.querySelectorAll("aside details")
|
|
8
8
|
.forEach((details) => details.toggleAttribute("open", matches));
|
|
9
9
|
toggleDetails(mediaQuery.matches);
|
|
10
10
|
mediaQuery.addEventListener("change", (event) => toggleDetails(event.matches));
|