DigiNews

Tech Watch by Johan Denoyer

← Back to articles

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

Quality: 8/10 Relevance: 9/10

Summary

This article surveys several CSS-based strategies for implementing theme-aware colors without JavaScript, including hard-coded selectors, color variables, color-mix, light-dark(), and if(). It discusses compatibility, trade-offs (maintainability, interpolation behavior, and browser support), and practical guidance for choosing a method based on theme count and browser support.

🚀 Service construit par Johan Denoyer