w3c / w3c/csswg-drafts

[mediaqueries-5] Ability to detect a preference override being cleared

Open
#13,613 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

mediaqueries-5
Dominant language
Bikeshed
Stars
4.9k
Forks
816
Avg merge
2d 18h
Merged PRs (30d)
24

Description

I’m implementing a little demo of a dark mode toggle as part of https://github.com/mdn/content/pull/43276. While doing so, I noticed that the change event isn’t fired if the old override matches the UA provided value.

In other words, change fires if value changes, not if override changes.

It would be useful to detect changes of the override value. This is needed for example to update a dark mode toggle which has the option System default.

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 with the mediaqueries-5 issue and the dark mode toggle context described in MDN content PR 43276. Examine how the change event currently depends on the value rather than the override, then define behavior for detecting an override being cleared. Done means a System default toggle can observe that transition, including when the old override matches the UA-provided value.

Written by the indexing model from the issue text.

Assessment

Tech stack
css
Domain
frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.