---
title: "#light-dark articles | Hashnode"
description: "Explore 2 articles tagged #light-dark on Hashnode. Tutorials, guides, and how-tos from the community."
url: "https://hashnode.com/tag/light-dark"
---

Tag

# #light-dark

2 posts · 0 followers

[Vihanga nivarthana](https://hashnode.com/@vihanga) · [Jun 9](https://hashnode.com/posts/the-css-light-dark-function/6a2859c152d5759b56ade590)

### [The CSS light-dark() Function](https://blog.vihanga.dev/the-css-light-dark-function?utm_source=hashnode&utm_medium=feed)

A Simpler Way to Handle Themes

4 min read · [blog.vihanga.dev](https://blog.vihanga.dev/the-css-light-dark-function?utm_source=hashnode&utm_medium=feed)

[YI-LIN CHEN (Eva)](https://hashnode.com/@im1010ioio) · [Sep 27, 2025](https://hashnode.com/posts/css-color-scheme-light-dark/68d82df8e09489747c799af4)

### [#77 實作網頁深色模式及淺色模式必備的 CSS 語法：color-scheme 與 light-dark()](https://im1010ioio.hashnode.dev/css-color-scheme-light-dark?utm_source=hashnode&utm_medium=feed)

⚠️ 本篇文章已搬遷至 css.im1010ioio.dev，請至新站閱讀完整版。 以前我們介紹過用 CSS Media Queries 的 prefers-color-scheme 讓網頁打開時預設切換淺色/深色模式，但是居然沒有講到最基礎的設定，就是「告訴瀏覽器我的網頁有支援哪種顏色主題：color-scheme」。 另外，我們順便再講解 light-dark() 這個 CSS 函式，可以讓你的 CSS 屬性，針對這兩種風格，分別指定不同的顏色。 而且這兩個語法目前都全瀏覽器支援囉！詳細...

1 min read · [im1010ioio.hashnode.dev](https://im1010ioio.hashnode.dev/css-color-scheme-light-dark?utm_source=hashnode&utm_medium=feed)
