akveo / akveo/ngx-admin

Support automatic theme detection from OS using prefers-color-scheme

未关闭
#5,542 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
enhancement help wanted
主要语言
TypeScript
星标
25.7k
派生
7.9k
PR 合并指标
30 天内没有已合并 PR

描述

### Issue type

**I'm submitting a ...** (check one with "x")

* [ ] bug report
* [x] feature request
* [ ] question about the decisions made in the repository

### Issue description

**Current behavior:**

The default theme loads automatically, despite user OS preferences.

**Expected behavior:**

By using `prefers-color-scheme` media query, it would be possible to detect the user OS theme. For example, if my Windows theme is dark, the `dark` theme of `ngx-admin` should be loaded. If my Windows theme is light, then the `light` theme of `ngx-admin` should be loaded.

This is demo'ed here: https://davidwalsh.name/demo/prefers-color-scheme.php
It already has decent browser support: https://caniuse.com/#search=prefers-color-scheme

**Steps to reproduce:**

**Related code:**

### Other information:

This thread is related: https://github.com/angular/components/issues/16905

**npm, node, OS, Browser**
OS: Windows 10
Browser: Chrome 77

**Angular, Nebular**

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。