Skip to main content

Crate dark_light

Crate dark_light 

Source
Expand description

This crate is designed to facilitate the development of applications that support both light and dark themes. It provides a simple API to detect the current theme mode.

It supports macOS, Windows, Linux, BSDs, and WASM.

On Linux the XDG Desktop Portal D-Bus API is checked for the color-scheme preference, which works in Flatpak sandboxes without needing filesystem access.

Structs§

Watcher
A handle to a background theme-change watcher.

Enums§

Error
An error that can occur when detecting the system theme mode.
Mode
Enum representing dark mode, light mode, or unspecified.

Functions§

detect
Detects the system theme mode.
stream
Subscribes to changes in the system theme mode using an async stream.
subscribe
Subscribes to changes in the system theme mode.