mi6 / mi6/ic-ui-kit

Internal issue 3048 - Dark mode issues

Open
#3,543 4 comments 0 reactions 0 assignees View on GitHub
spike
Dominant language
TypeScript
Stars
53
Forks
63
Avg merge
2d 4h
Merged PRs (30d)
15

Description

Stackblitz example: [https://stackblitz.com/edit/wn3wt6xa-qd55k4re?file=index.html|https://stackblitz.com/edit/wn3wt6xa-qd55k4re?file=index.html]

Despite explicitly setting the theme to light mode only using the {{ic-theme}} component, the text on the page is still changing from dark-mode to light-mode when that setting is changed.

This might be a case of “what should the behavior actually be?” rather than a bug, as it might be that developers not implementing dark mode should just fix these issues themselves for their particular applciation - however, if the intention was for dark mode to be an “opt-in” feature, this is not currently the case.

This is the kind of issue that might have evaded testing because it’ll only manifest under certain conditions - generally, the two big ones will be…

* A user explicitly sets a background color without explicitly setting a text color (they might not expect the text color to change when the user selects a dark mode preference, but it will!).
* A user explicitly opts out of supporting dark mode using the {{color-scheme: only light}} CSS style.

In my case, this resulted in a (mostly very easy) ICDS upgrade causing my app to become unusable if the user happened to have “dark mode” set as their preferred appearance (which I didn’t notice until after the app was in production).

Contributor guide

Open the contributing guide

Research direction

Start with the linked StackBlitz example and its index.html, then trace how the ic-theme component applies theme styles and how color-scheme: only light is handled. Confirm the intended opt-in behavior with the issue discussion, and define done by reproducing the unwanted text-color change and verifying the agreed behavior in relevant theme tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
css, html, typescript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.