linebender / linebender/druid

Dark or light mode detection

Open
#2,190 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement help wanted
Dominant language
Rust
Stars
9.7k
Forks
565
PR merge metrics
No merged PRs in 30d

Description

Hello, is there any way to detect light or dark mode on the system an application is running on to change themes respectively?

After looking for a while I can't find any mention of it in Druid, and no Druid example seems to adhere to the dark/light mode setting (at least on MacOS) despite its [theme containing keys](https://docs.rs/druid/latest/druid/theme/index.html#constants) for [dark](https://docs.rs/druid/latest/druid/theme/constant.BACKGROUND_DARK.html) and [light](https://docs.rs/druid/latest/druid/theme/constant.BACKGROUND_LIGHT.html) colors?

Should I just rely on the [dark-light](https://crates.io/crates/dark-light) crate for now and check periodically?

Screen Shot 2022-05-18 at 10 48 09 AM

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the linked druid::theme constants and the existing examples to determine how themes are selected. Compare that behavior with the dark-light crate mentioned in the issue and identify the supported platform-specific detection points. Done means the project’s support or limitation for system light/dark mode is clearly established, with any required behavior covered by tests or documentation.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
desktop
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.