WeSearch

A few ways of specifying per-theme colours in only CSS

Chris Morgan· ·10 min read · 0 reactions · 0 comments · 17 views
#css#web development#design
TL;DR · WeSearch summary

The article discusses various methods for specifying per-theme colors using only CSS. It highlights techniques such as using color palette variables and the light-dark() function. The author shares personal insights on the challenges and considerations when implementing these methods.

Key facts
About this source

Lobsters files mainly under programming. We currently carry 173 of its stories.

Original article
Chrismorgan · Chris Morgan
Read full at Chrismorgan →
Opening excerpt (first ~120 words) tap to expand

A few ways of specifying per-theme colours in only CSS 🗓️ 2026-05-16 (last updated 2026-05-20) • Tagged /css, /meta=also Table of contents: The assumed basic HTML and CSS Write it all out the hard way (doesn’t scale very well) Lots of colour palette variables (what normal people do) The space toggle hack (poor man’s if()) color-mix() with one variable per theme (I settled on this for this site, but I’m weird) light-dark() (consider using this these days, instead of or combined with palette variables) if() (maybe some time soon) Paused @keyframes animation (probably a bad idea) Summary (a comparison table) Bonus 1. Parametric colours Bonus 2. @function and @mixin I was thinking about this as part of putting this website together.

Excerpt limited to ~120 words for fair-use compliance. The full article is at Chrismorgan.

Anonymous · no account needed
Share 𝕏 Facebook Reddit LinkedIn Threads WhatsApp Bluesky Mastodon Email

Discussion

0 comments

More from Chrismorgan