XMOJ-Script-dev / XMOJ-Script

XMOJ增强脚本
https://www.xmoj-bbs.me
GNU General Public License v3.0
5 stars 5 forks source link

[Feature Request] Auto set light mode or dark mode based on system settings #314

Open boomzero opened 11 months ago

boomzero commented 11 months ago

检查项

描述

提示:https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme

原因

No response

boomzero commented 11 months ago
// Check if the user prefers a dark color scheme
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
  // User prefers dark color scheme
  console.log('User prefers dark color scheme');
} else {
  // User prefers light color scheme
  console.log('User prefers light color scheme');
}
PythonSmall-Q commented 11 months ago

我也在这样想

PythonSmall-Q commented 11 months ago

tnnd《提示》

boomzero commented 11 months ago

https://github.com/boomzero/quicksubmit

On Dec 23, 2023, at 14:33, Shan Wenxiao @.***> wrote:

tnnd《提示》

— Reply to this email directly, view it on GitHub https://github.com/XMOJ-Script-dev/XMOJ-Script/issues/314#issuecomment-1868221620, or unsubscribe https://github.com/notifications/unsubscribe-auth/AULMJZNFJAEHWEQPH2JMOUTYKZ3MNAVCNFSM6AAAAABA7YXGASVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNRYGIZDCNRSGA. You are receiving this because you authored the thread.

langningchen commented 10 months ago

这个很简单呀

boomzero commented 10 months ago

这个很简单呀

@langningchen 我知道, 但是不知道怎么让用户设置

langningchen commented 10 months ago

根據系統設置自動設置

langningchen commented 10 months ago

跟随系统设置

boomzero commented 10 months ago

那如果用户同时选择暗色模式和这个呢?

On Jan 30, 2024, at 17:21, Langning Chen @.***> wrote:

跟随系统设置

— Reply to this email directly, view it on GitHub https://github.com/XMOJ-Script-dev/XMOJ-Script/issues/314#issuecomment-1916401225, or unsubscribe https://github.com/notifications/unsubscribe-auth/AULMJZKQRNIG36MQ2MGV2BLYRC3QPAVCNFSM6AAAAABA7YXGASVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMJWGQYDCMRSGU. You are receiving this because you authored the thread.

langningchen commented 10 months ago

那么以用户选择为准,用户可以选择:

boomzero commented 10 months ago

那么以用户选择为准,用户可以选择:

* Light mode

* Dark mode

* Same as system settings (Default)

但是不能三个都选

langningchen commented 10 months ago

当然了

boomzero commented 9 months ago

I wanted to start working on this, but things are so... chaotic, so...

~new OSS project~

PythonSmall-Q commented 3 months ago

小棉袄开始做这个了吗(bushi

笑死我怎么打出来的

boomzero commented 3 months ago

那么以用户选择为准,用户可以选择:

* Light mode

* Dark mode

* Same as system settings (Default)

但是不能三个都选

我不知道如何强制用户三选一

boomzero commented 3 months ago

可以写提示,然后… I think I know what to do

boomzero commented 3 months ago

跟随系统设置

@langningchen because 三选一

boomzero commented 3 months ago

那么以用户选择为准,用户可以选择:

  • Light mode
  • Dark mode
  • Same as system settings (Default)

So: