ni / ni/nimble

Make nimble aware of prefers-color-scheme

Open
#647 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
TypeScript
Stars
39
Forks
14
Avg merge
1d 16h
Merged PRs (30d)
13

Description

😯 Problem to Solve

The browser has the prefers-color-scheme media query for letting web applications be aware of the operating system configured light / dark mode setting.

Nimble should be aware of that configuration so nimble applications can automatically adjust to the operating system configured theme preference.

💁 Proposed Solution

  • Currently nimble's default theme is the Light theme. So if a user does not provide a <nimble-theme-provider> on the page then the default theme value will be light. We should instead make the default theme be the OS configured theme setting.
  • Nimble theme-provider should have an option for the theme property that allows explicitly configuring the OS specified preferred theme. ie theme = light | dark | color | platform

As part of a primeday project I prototyped with adding a platform option to the theme-provider's theme property.

We should still have an HLD to pin down the requirements and API for this change beyond the proposed solution.

📋 Tasks

  • HLD

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 theme-provider entry point at packages/nimble-components/src/theme-provider/index.ts and review the linked prototype for the proposed platform option. Draft the required HLD to settle the theme API and prefers-color-scheme behavior. Done means the requirements are agreed and the theme provider can represent an explicitly selected or OS-preferred theme.

Written by the indexing model from the issue text.

Assessment

Tech stack
css, typescript
Domain
design, frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.