Scroll to top

Today

The home on the web of Colin Walker.
Find out more on /about, say /EHLO, or tune in to the daily RSS feed.

2026/07/31#p1

The first wave of CSS tweaks are complete.

I was getting a bit bored (no surprise there) so wanted to mix things up a little bit. Cue user selected colour themes:

Theme selection on menu

Choosing an option from the menu simply sets a key-value pair in the browser's local storage. Before the page loads, a quick bit of JavaScript checks this value and sets a page level data value:

<html lang="en-GB" data-theme="blue">

The CSS then loads the right colours:

:root[data-theme="blue"] {
    ...
}
Amber theme Blue theme

The theme affects the title bar, bottom bar, icons, menu and comments panel. Nothing drastic, but adds a little personality.

Bottom bar with theme

Oh, and the choice persists between browser sessions.

No comments yet
Leave a reply



You can also:

Click here to reply using email Reply by email Send a webmention Send a Webmention



Close