From 67478113cbc3b15645b67a83d002c13e0b2416af Mon Sep 17 00:00:00 2001 From: Fabian Stamm Date: Fri, 27 Mar 2020 11:04:50 +0100 Subject: [PATCH] Switching to different style of theme selection --- index.html | 537 ++++++++++++++++++++++------------------- package.json | 10 +- src/_maketheme.scss | 16 +- src/build-pref.scss | 3 + src/build.scss | 5 + src/dark.scss | 2 + src/light.scss | 4 +- src/theme/_btn.scss | 6 +- src/theme/_card.scss | 4 +- src/theme/_global.scss | 5 +- src/theme/_header.scss | 2 +- src/theme/_input.scss | 6 +- src/theme/_list.scss | 4 +- src/theme/_modal.scss | 2 +- src/theme/_table.scss | 2 +- 15 files changed, 326 insertions(+), 282 deletions(-) create mode 100644 src/build-pref.scss create mode 100644 src/build.scss diff --git a/index.html b/index.html index ab8d931..b7808cd 100644 --- a/index.html +++ b/index.html @@ -1,277 +1,304 @@ + + + + + + - - - - - - - - const light = "./out/light.css"; - const dark = "./out/dark.css" - - let active; - - function applyStyleSheet(d = false) { - let n = createStyle(d ? dark : light); - if (n === active) - return; - - if (active) - active.remove(); - - document.head.appendChild(n); - active = n; - } - - applyStyleSheet(false); - let isLight = true; - - function switchStyle() { - applyStyleSheet(isLight); - isLight = !isLight; - } - - window.$ = document.querySelector.bind(document); - - let match = window.matchMedia("prefers-color-scheme: dark"); - match.addListener((ev) => { - applyStyleSheet(ev.matches) - }) - - - + .scroll-test { + height: 100px; + overflow-y: scroll; + } + + - - -
- - - - -