next-theme / hexo-theme-next

🎉 Elegant and powerful theme for Hexo.
https://theme-next.js.org
Other
2.45k stars 434 forks source link

add multi-color scheme support #270

Open jiangtj opened 3 years ago

jiangtj commented 3 years ago

Please follow this Issue template to provide relevant information, such as source code repository, website URL and screenshots, which will help us investigate. 请按照此 Issue 模版提供相关信息,例如源码仓库、网站链接和屏幕截图,这将有助于我们进行调查。

Issue Checklist


Expected behavior

I found out that GitHub changed its darkmode scheme. It can choose two colors to be switched automatically by the system, or select a single color scheme. So we can refer to it to improve our theme.

Single theme image

Sync with system image

For our theme style, it is easy to implement, since mimi extracted the colors

for example image blue.styl

@import 'light';
// custom color ...
:root {
  --text-color: blue;
}

But for some third-party plug-ins, we need to consider how to integrate. :expressionless:

for example image image image

liushulun commented 2 years ago

Expect for that too!

Theme can only be switched by OS or browser for now. Add [Prefer theme] to force only one theme will be really helpful to me 🙏

sghuang19 commented 2 months ago

Expect for that too!

Theme can only be switched by OS or browser for now. Add [Prefer theme] to force only one theme will be really helpful to me 🙏

This is going to be quite useful, a really valid use case.

sghuang19 commented 2 months ago

@stevenjoezhang Our current way of doing dark mode is quite inconsistent and incomplete. What do you think?

Ideally color variables should be defined at the top level Stylus file. But in some places this is done at a class/component level.

Once we figured out a way to centralize that, the rest should be easy.

But for now @jiangtj you would have to carefully pick a file that looks ok on both bright and dark mode, sry for that 😢