Search
Come to the light-dark() Side
25.10.2024
You’d be forgiven for thinking coding up both a dark and a light mode at once is a lot of work. You have to remember @media queries based on prefers-color-scheme as well as extra complications that arise when letting visitors …
Come to the light-dark() Side originally published...
Detect System Theme Preference Change Using JavaScript
24.10.2022
JavaScript and CSS allow users to detect the user theme preference with CSS’ prefers-color-scheme media query. It’s standard these days to use that preference to show the dark or light theme on a given website. But what if the user changes their preference while using your app?...
Honor prefers-color-scheme in the CSS Paint API with Custom Properties
27.12.2021
One of the coolest things I’ve been messing with in the last couple years is the CSS Paint API. I love it. I did a talk on it, and made a little gallery of my own paint worklets…
Meta Theme Color and Trickery
13.7.2021
Starting with Version 15, Safari supports the theme-color <meta> tag both on macOS and iOS. That’s exciting news because now the first desktop browser supports this <meta> tag and it also supports the media attribute and the prefers-color-scheme media feature.…
The post Meta...
Safari 15: New UI, Theme Colors, and… a CSS-Tricks Cameo!
11.6.2021
There’s a 33-minute video (and resources) over on apple.com covering the upcoming Safari changes we saw in the WWDC keynote this year in much more detail. Look who’s got a little cameo in there:
Perhaps the most noticeable thing there …
The post Safari 15: New UI, Theme Colors...
Creating websites with prefers-reduced-data
8.12.2020
Spoiler alert: There is no support for it yet. But it is defined in the Media Queries Level 5 spec that includes other recent, but more familiar user preference features, like prefers-color-scheme and prefers-reduced-motion.
The Polypane blog goes into incredible depth on prefers-reduced-data...
CSS background-repeat: round
23.6.2020
The CSS spec is full of gems that sneak their way past most of us web designers and developers. Stuff like :focus-within, prefers-reduced-motion, and prefers-color-scheme suddenly make their way into CSS without us really finding out for months or years. One such example is background-repeat:...
How to Display Mode-Specific Images
4.5.2020
Now that we have most of the basics of HTML and CSS in the browser, we’ve begun implementing new features that I would consider “quality of life” improvements, many of which have been inspired by mobile. One great example is the CSS prefers-color-scheme media query, which allows...
The Web in 2020: Extensibility and Interoperability
22.1.2020
In the past few years, we’ve seen a lot of change and diversion in regard to web technologies. In 2020, I foresee us as a web community heading toward two major trends/goals: extensibility and interoperability. Let’s break those down.
Extensibility
Extensibility describes...
The Ultimate Guide to Dark Mode for Email Marketers
7.1.2020
On the regular web (I suppose) we handle "dark mode" with the CSS prefers-color-scheme media query. But, and to nobody's surprise, it's way weirder in the land of HTML email. The weirdness is that across different email clients, they handle the dark mode thing differently, starting with the fact...
Dark Mode Favicons
4.12.2019
Oooo! A bonafide trick from Thomas Steiner. Chrome will soon be supporting SVG favicons (e.g. <link rel="icon" href="/icon.svg">). And you can embed CSS within an SVG with a <style> element. That CSS can use a perfers-color-sceme media query, and as a result, a favicon that supports...
A Dark Mode Toggle with React and ThemeProvider
25.9.2019
I like when websites have a dark mode option. Dark mode makes web pages easier for me to read and helps my eyes feel more relaxed. Many websites, including YouTube and Twitter, have implemented it already, and we’re starting to see it trickle onto many other sites as well.
In this tutorial, we’re...
A Quick Look at the First Public Working Draft for Color Adjust Module 1
29.5.2019
We've been talking a lot about Dark Mode around here ever since Apple released it as a system setting in MacOS 10.14 and subsequently as part of Safari. It's interesting because of both what it opens up as as far as design opportunities as well as tailoring user experience based on actual user...
prefers-color-scheme: CSS Media Query
28.1.2019
One device and app feature I’ve come to appreciate is the ability to change between light and dark modes. If you’ve ever done late night coding or reading, you know how amazing a dark theme can be for preventing eye strain and the headaches that result. macOS recently implemented...
WDRL — Edition 246: Custom Elements News, React lazy Method, The `prefers-color-scheme` Media Query And Human Customer Support
26.10.2018
Hey,
The web is fascinating. Just when you think there’s not much news happening right now you’re proved wrong. This week brings massive news for how we can work with Custom Elements given the very good fresh support in Firefox (along with Chrome which has support since a while already) and some...