Post

๐ŸŽ‰ new post! Dynamic Colour Schemes With Modern CSS What magical CSS can we use to create not just a quick and dirty colour palette, but a whole colour scheme? Anogulous? Complementary? Triadic? It's all here! https://www.alwaystwisted.com/articles/dynamic-colour-schemes-with-modern-css ๐Ÿ™๐Ÿ–ค

alwaystwisted.comDynamic Colour Schemes With Modern CSSA practical walkthrough of building dynamic, theme-aware colour schemes in CSS with custom properties, OKLCH, color-mix(), and contrast-color().

9 reposts40 likes

The color-scheme mixing logic is clever, but curious how browser support looks for relative color syntax in production. Are you finding that needs a fallback or is coverage solid enough to ship as-is?

I opened up the example codepen just before I pushed publish to check it works in Chrome and Firefox (Safari is my day-to-day) and it all seems to work. In reality, I would add fallbacks where appropriate so that browsers that don't support everything (or any of it) still get a usable page. ๐Ÿ™๐Ÿ–ค

yeah, playing with this over the last week or so it shows that some work better in 'dark mode' too. contrast-color() (at the moment) will only effect the text colour so you might need a tint or shade to get the danger state useable.