<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/the-future-of-css-easy-light-dark-mode-color-switching-with-light-dark--01rgox9mw" -->

---
title: The Future of CSS: Easy Light-Dark Mode Color Switching...
description: CSS now comes with a utility function named light-dark(). This function allows you to change a color value based on whether Light Mode or Dark Mode is being...
canonical: https://daily.dev/posts/the-future-of-css-easy-light-dark-mode-color-switching-with-light-dark--01rgox9mw
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: The Future of CSS: Easy Light-Dark Mode Color Switching with light-dark() | daily.dev
og:description: CSS now comes with a utility function named light-dark(). This function allows you to change a color value based on whether Light Mode or Dark Mode is being...
og:url: https://daily.dev/posts/the-future-of-css-easy-light-dark-mode-color-switching-with-light-dark--01rgox9mw
og:image: https://api.daily.dev/og/posts/01rgOx9mw.png
og:image:alt: The Future of CSS: Easy Light-Dark Mode Color Switching with light-dark()
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# The Future of CSS: Easy Light-Dark Mode Color Switching with light-dark()

**[Community Picks](https://daily.dev/sources/community)** · 5 min read · 162 upvotes · 3 comments

## Summary

CSS now comes with a utility function named light-dark(). This function allows you to change a color value based on whether Light Mode or Dark Mode is being used. It is an intermediary step towards a final solution for responding to different color schemes.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.bram.us/2023/10/09/the-future-of-css-easy-light-dark-mode-color-switching-with-light-dark/>

## Community discussion

Top comments from developers on daily.dev.

**@palmiak** · 4 upvotes

> This is so much better (visually) than the media query. Can't wait for Chrome and Safari to add it too.

**@narcco** · 1 upvotes

> nice , they made it with python right ?

## Similar posts on daily.dev

- [Don’t just attend KubeCon \+ CloudNativeCon, Merge Forward your experience\!](https://daily.dev/posts/don-t-just-attend-kubecon-cloudnativecon-merge-forward-your-experience--l0rpp73x8) · CNCF · 1 upvotes · 0 comments
- [Announcing H2 2026 KCDs](https://daily.dev/posts/announcing-h2-2026-kcds-m96goajm1) · CNCF · 1 upvotes · 0 comments
- [Two months of Open Community Groups](https://daily.dev/posts/two-months-of-open-community-groups-asf52zhbs) · CNCF · 0 upvotes · 0 comments
- [CNCF Unveils Schedule for KubeCon \+ CloudNativeCon Europe 2026](https://daily.dev/posts/cncf-unveils-schedule-for-kubecon-cloudnativecon-europe-2026-ikhcoa5cb) · CNCF · 2 upvotes · 0 comments
- [CNCF Debuts KubeCon \+ CloudNativeCon Japan 2026 Schedule](https://daily.dev/posts/cncf-debuts-kubecon-cloudnativecon-japan-2026-schedule-xp5pyudub) · CNCF · 1 upvotes · 0 comments

---

Tags: [#webdev](https://daily.dev/tags/webdev), [#css](https://daily.dev/tags/css)

[View this post on daily.dev](https://daily.dev/posts/the-future-of-css-easy-light-dark-mode-color-switching-with-light-dark--01rgox9mw)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"The Future of CSS: Easy Light-Dark Mode Color Switching with light-dark()","url":"https://daily.dev/posts/the-future-of-css-easy-light-dark-mode-color-switching-with-light-dark--01rgox9mw","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/the-future-of-css-easy-light-dark-mode-color-switching-with-light-dark--01rgox9mw"},"datePublished":"2023-10-12T08:45:00.572Z","dateModified":"2023-12-07T12:02:45.284Z","description":"CSS now comes with a utility function named light-dark(). This function allows you to change a color value based on whether Light Mode or Dark Mode is being...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/6a55bdfd44cb7411e4bfa6974ca44c1b?_a=AQAEufR","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/6a55bdfd44cb7411e4bfa6974ca44c1b?_a=AQAEufR","isAccessibleForFree":true,"articleSection":"Community Picks","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Community Picks","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1655817725/logos/community","url":"https://daily.dev/sources/community"},"commentCount":3,"discussionUrl":"https://daily.dev/posts/the-future-of-css-easy-light-dark-mode-color-switching-with-light-dark--01rgox9mw","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":162},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":3}],"keywords":"webdev,css","timeRequired":"PT5M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Community Picks","item":"https://daily.dev/sources/community"},{"@type":"ListItem","position":3,"name":"The Future of CSS: Easy Light-Dark Mode Color Switching with light-dark()"}]}
{"@context":"https://schema.org","@type":"WebPage","@id":"https://daily.dev/posts/the-future-of-css-easy-light-dark-mode-color-switching-with-light-dark--01rgox9mw","comment":[{"@type":"Comment","text":"This is so much better (visually) than the media query. Can’t wait for Chrome and Safari to add it too.","datePublished":"2023-10-16T14:45:01.691Z","url":"https://daily.dev/posts/01rgOx9mw#c-GWK2388fk","author":{"@type":"Person","name":"Maciek Palmowski","url":"https://daily.dev/palmiak","image":"https://lh3.googleusercontent.com/a-/AOh14GjxtqOGjKYIBWkX-qEGCajyrjha0d8Q4ZhGE6Hl-A=s100"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":4}},{"@type":"Comment","text":"nice , they made it with python right ?","datePublished":"2023-10-17T19:32:19.942Z","url":"https://daily.dev/posts/01rgOx9mw#c-L0655PAbc","author":{"@type":"Person","name":"Narcco","url":"https://daily.dev/narcco","image":"https://lh3.googleusercontent.com/a/AGNmyxZHbQ32ywTTKFAvJyBXvGXgAZxBN4xpt-T213cj=s96-c"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1}}]}
```

