As a user I want to see an new interface, choose a color palette I like, either by choosing a color and having the interface fill in the blanks, or by choosing a harmoniously design palette.
window.localStorage.getItem('theme')window.matchMedia("(prefers-color-scheme: ${theme-name}").matcheswindow.localStorage.setItem('theme', 'theme-name')[data-theme] on the HTMLElement.theme-${name} class on the bodycheckThemePref() {let savedTheme, mediaPref, dayOrNight;const tiempo = new Date().getHours();if (window.localStorage) { savedTheme = localStorage.getItem("theme") || "default" }if (window.matchMedia("(prefers-color-scheme)").media !== "not all") {mediaPref = window.matchMedia("(prefers-color-scheme: dark)").matches ? "night" : "day"}if (tiempo) dayOrNight = tiempo < 7 && tiempo > 19 ? "night" : "day";return savedTheme || mediaPref || dayOrNight;}
On nameless I got to feeling that the themes ought to feel natural, to evoke familiar fundamental conditions: light and dark, day and night, wet and dry, sea and sky and land. Here in commonplace we're exploring this further, and more easily thanks to the next-themes library. Yes I've ripped out my handroll and gone with the herd 😝