Skip to content

v3.0.0

Latest

Choose a tag to compare

@edfloreshz edfloreshz released this 12 Aug 20:24
· 1 commit to main since this release

We're thrilled to announce the release of version 3.0.0! 🚀

After listening to your feedback, this update brings exciting changes to the API.

Consumers can now react to system theme changes instead of only polling detect(). Two new entry points are available:

  • dark_light::subscribe() -> Result<Watcher, Error> — a blocking watcher for any thread or event-loop poll, no async runtime required.
  • dark_light::stream() -> Result<impl Stream<Item = Mode>, Error> — an async adapter over the same watcher. Enabled by default via the async-io feature, or tokio.

This works across all supported platforms: the XDG portal's SettingChanged D-Bus signal on Linux/BSD, RegNotifyChangeKeyValue on Windows, and the native MediaQueryList change event on WASM.

On macOS, changes are currently detected via a 1-second polling thread rather than a native notification. Observing NSDistributedNotificationCenter requires a hand-rolled Objective-C delegate that isn't yet safely exposed by the objc2 bindings we use, so we're shipping this version now and may revisit it later.

We had originally removed this feature entirely over the macOS limitation, but Linux, Windows, and WASM all had working implementations, and macOS was the only blocker. Dropping the feature for everyone over one platform's rough edges didn't sit right, so we're reintroducing it here.

What's Changed

New Contributors

Full Changelog: 2.0.0...3.0.0