# Using light-dark() without getting caught out

DevFeed: [Using light-dark() without getting caught out](<https://devfeed.tech/articles/using-light-dark-without-getting-caught-out-158740.md>)

Original publisher: [Read original article](<https://css-tricks.com/using-light-dark-without-getting-caught-out/>)

Author: Geoff Graham

Published: 2026-11-27T16:01:31Z

Content type: article

Language: en

Sources: [CSS-Tricks](<https://devfeed.tech/sources/css-tricks.md>)

Topics: [Dark Mode](<https://devfeed.tech/topics/dark-mode.md>), [Media Queries](<https://devfeed.tech/topics/media-queries.md>), [color](<https://devfeed.tech/topics/color.md>)

Tags: [css](<https://devfeed.tech/tags/css.md>), [css-variables](<https://devfeed.tech/tags/css-variables.md>), [dark-mode](<https://devfeed.tech/tags/dark-mode.md>), [dx](<https://devfeed.tech/tags/dx.md>), [fallback](<https://devfeed.tech/tags/fallback.md>), [light-dark](<https://devfeed.tech/tags/light-dark.md>), [links](<https://devfeed.tech/tags/links.md>), [media-queries](<https://devfeed.tech/tags/media-queries.md>), [performance](<https://devfeed.tech/tags/performance.md>), [rendering](<https://devfeed.tech/tags/rendering.md>)

## AI overview

The author favors `light-dark()` for simpler theme authoring, but notes that unsupported browsers can fall back to black text on white in Light Mode and white text on dark gray in Dark Mode, so thorough testing and cascade fallbacks are advised. To reduce repeated values, the author builds CSS custom-property tokens for light/dark pairs, eventually using general `--light-dark` and `--dark-light` variables; the approach feels manageable but is not presented as perfect. Martin Underhill questions whether `light-dark()` is worth the fallback work compared with media queries, reporting negligible byte savings. The author's CSS-Tricks comparison found a modest difference that helped justify the choice for developer experience.

## Source excerpt

I honestly hadn't thought about "getting caught" by light-dark() -- particularly when leaning heavily on it for this site -- but Martin Underhill explains the user and rendering considerations, making me reflect on my choices as well. Using light-dark() without getting caught out originally handwritten and published with love on CSS-Tricks. You should really get the newsletter as well.