# 다크 모드를 확인하는 데 여전히 이 방법이 맞나요?

**URL:** <https://meta.discourse.org/t/is-this-still-the-solution-for-checking-for-dark-mode/353354>\
**Category:** Development\
**Created:** [2월 20, 2025, 3:56오후 UTC](https://meta.discourse.org/t/is-this-still-the-solution-for-checking-for-dark-mode/353354 "2025-02-20T15:56:12Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![Alteras](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alteras/32/582398_2.png) [@Alteras](https://meta.discourse.org/u/Alteras)\
**Post date:** [2월 20, 2025, 6:46오후 UTC](https://meta.discourse.org/t/is-this-still-the-solution-for-checking-for-dark-mode/353354/5 "2025-02-20T18:46:26Z")

</div>

순수 CSS 솔루션은 아마도 `--scheme-type` CSS 변수, 혹은 몇 시간 전에 추가된 `color-scheme` 속성(와우!)을 [`@container` 스타일 쿼리](https://developer.mozilla.org/en-US/docs/Web/CSS/@container#container_style_queries) 또는 [`light-dark()`](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value/light-dark)와 함께 사용할 것입니다.

[https://github.com/discourse/discourse/blob/834ea70b1ce3f06e6e03d25ebee0567596ad26c2/app/assets/stylesheets/color\_definitions.scss#L5-L7](https://github.com/discourse/discourse/blob/834ea70b1ce3f06e6e03d25ebee0567596ad26c2/app/assets/stylesheets/color_definitions.scss#L5-L7)

불행히도 `light-dark()`는 색상 값에만 작동합니다. `color-scheme` 속성을 대상으로 하는 `@container` 스타일 쿼리를 사용할 수 있을 것입니다(파이어폭스는 아직 사용자 정의 속성에 대한 스타일 쿼리를 지원하지 않습니다). 현재 개발 환경이 다운되어 있어 이 아이디어를 테스트해 볼 수 없었습니다.

루트 요소에 전용 `.dark-mode` 또는 `.light-mode` 클래스를 사용하는 것이 작업하기에 확실히 가장 쉬울 것입니다.

---

_[View the full topic](https://meta.discourse.org/t/is-this-still-the-solution-for-checking-for-dark-mode/353354)._
