# How to add a specific body class for the dark (or light) mode?

**URL:** <https://meta.discourse.org/t/how-to-add-a-specific-body-class-for-the-dark-or-light-mode/220062>\
**Category:** Product Support\
**Created:** [March 4, 2022, 2:30pm UTC](https://meta.discourse.org/t/how-to-add-a-specific-body-class-for-the-dark-or-light-mode/220062 "2022-03-04T14:30:29Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![jordan.vidrine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jordan.vidrine/32/515563_2.png) [@jordan.vidrine](https://meta.discourse.org/u/jordan.vidrine)\
**Post date:** [March 4, 2022, 4:46pm UTC](https://meta.discourse.org/t/how-to-add-a-specific-body-class-for-the-dark-or-light-mode/220062/5 "2022-03-04T16:46:55Z")

</div>

Using `.cooked a` as a css target should work for you to set a custom color for these links.

While our core system now allows the use of dark / light color scheme choices for their corresponding modes, you should also be able to use the css media query for dark/light modes like so:

> **[prefers-color-scheme CSS media feature - CSS | MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/At-rules/@media/prefers-color-scheme)**
>
> The prefers-color-scheme CSS media feature is used to detect if a user has requested light or dark color themes.
> A user indicates their preference through an operating system setting (e.g., light or dark mode) or a user agent setting.

---

_[View the full topic](https://meta.discourse.org/t/how-to-add-a-specific-body-class-for-the-dark-or-light-mode/220062)._
