From e012cfa2f63c900ba7c2cdf2a80954524b37ce8f Mon Sep 17 00:00:00 2001 From: Pagwin Date: Fri, 22 Aug 2025 12:48:57 -0400 Subject: [PATCH] more post work --- posts/platonically-ideal-light-dark-toggle.md | 25 ++++++- static/demos/light-dark-demo-2/index.html | 67 +++++++++++++++++++ static/demos/light-dark-demo-3/index.html | 56 ++++++++++++++++ 3 files changed, 146 insertions(+), 2 deletions(-) create mode 100644 static/demos/light-dark-demo-2/index.html create mode 100644 static/demos/light-dark-demo-3/index.html diff --git a/posts/platonically-ideal-light-dark-toggle.md b/posts/platonically-ideal-light-dark-toggle.md index 2ec0aef..94d021a 100644 --- a/posts/platonically-ideal-light-dark-toggle.md +++ b/posts/platonically-ideal-light-dark-toggle.md @@ -10,9 +10,30 @@ draft: true tags: [] --- -Many blogs have a button you can use to toggle between their light and dark themes. -Unfortunately this button is often done in the obvious way which has issues. +Many blogs and other sites have a way to toggle between their light and dark themes. +However many of these toggles are... not ideal, making various tradeoffs. +So I thought it'd be interesting to explore these tradeoffs and throw my own hat into the ring with a potentially better solution. + + + +## What Does it Mean to be Ideal? + ## The Obvious Way [demo]() + +## A Suboptimal Solution + +A trick from from [](https://www.joshwcomeau.com/react/dark-mode/) + +[demo]() + + +## An Ideal Stateless Toggle + +[demo]() + +## An ideal solution + + diff --git a/static/demos/light-dark-demo-2/index.html b/static/demos/light-dark-demo-2/index.html new file mode 100644 index 0000000..ba3e9dc --- /dev/null +++ b/static/demos/light-dark-demo-2/index.html @@ -0,0 +1,67 @@ + + + + + + + Demo of the simplest implementation of a light/dark theme toggle + + + + + + +

This is a basic demo, it needs Javascript to make the button work

+ + + + diff --git a/static/demos/light-dark-demo-3/index.html b/static/demos/light-dark-demo-3/index.html new file mode 100644 index 0000000..c9ef8e8 --- /dev/null +++ b/static/demos/light-dark-demo-3/index.html @@ -0,0 +1,56 @@ + + + + + + + Demo of the simplest implementation of a light/dark theme toggle + + + + + +

This is a basic demo, unlike the other demos it doesn't need javascript to work, Pico CSS was used for some basic + styling but this technique works without it

+ + + +