···220220></script>
221221```
222222223223+### `responsive-sidebar.js`
224224+225225+This addon automatically opens and closes `<details>` elements inside sidebars at the 82rem breakpoint. This prevents sidebars from looking awkward on wide screens and improves usability on small screens. To use this addon, add the following line after the `dev.css` import:
226226+227227+```html
228228+<script
229229+ src="https://cdn.jsdelivr.net/npm/@intergrav/dev.css@4/addon/responsive-sidebar.min.js"
230230+ defer
231231+></script>
232232+```
233233+223234## Themes
224235225236dev.css supports custom colors and fonts through themes. You can find some pre-made themes in the `/theme` folder. To use a theme, simply apply it after the dev.css stylesheet. There are night and day themes, a set of Catppuccin themes, and a terminal theme. For example, to apply the terminal theme, add the following line after the `dev.css` import:
+10
addon/responsive-sidebar.js
···11+/* responsive-sidebar for dev.css v4, a lightweight CSS framework - https://github.com/intergrav/dev.css */
22+/* about: auto open/close `aside article details` at 82rem breakpoint. prevents sidebar from looking awkward on wide screens, improves usability on small screens */
33+44+const mediaQuery = matchMedia("(min-width: 82rem)");
55+const toggleDetails = (matches) =>
66+ document
77+ .querySelectorAll("aside article details")
88+ .forEach((details) => details.toggleAttribute("open", matches));
99+toggleDetails(mediaQuery.matches);
1010+mediaQuery.addEventListener("change", (event) => toggleDetails(event.matches));