-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add dark mode #64
Add dark mode #64
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/kaiyiwing/qwerty-learner/3b4huocrr |
感谢您的贡献,我们会在合并完现在两个高优先级 PR 后再来仔细处理这个 PR。 我建议安排一个快捷键,因为其他按钮也都有快捷键。 关于色板的选取,可以参考《8 Tips for Dark Theme Design》这篇文章里的规则。 |
4514739
to
b9864f4
Compare
配色没有完全按照 《8 Tips for Dark Theme Design》 中的建议做,原因是 TailwindCSS 自带色板在不做扩展的情况下有些难以满足其中诸如对比度等要求,作为深色模式初稿我还是暂时先使用 TailwindCSS 提供的配色方案以保证配色的协调性。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would you like to remove the empty file src/components/Modals/index.module.css
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
未适配 Donate 界面
Donate 界面通过点击 Footer 的咖啡图标弹出
fixed |
@Kaiyiwing 在 PR comment 中有说明,或许需要提供深色背景二维码图片再进行适配 |
我简单查了一下,深色的二维码识别有问题,所以我觉得可以暂时将 Donate 其他部分适配深色,暂不处理二维码? |
ok,我稍后弄一下 |
目前您的 pr 基于的分支应该落后于 dev 分支了,麻烦您重新 pull 一下,感谢! |
我们刚在 dev 分支进行了一次更新,所以会出现 Conflicting file |
这次更新有点大,我建议让 @chengluyu 一起进行 merge吧 |
好的。 |
@CLDXiang 刚刚给您 Github 预留的邮箱发了邀请,如果有兴趣欢迎加入我们 |
嗯嗯,这个项目挺好玩的,但我似乎没有收到邮件 |
这个 pr 由我在负责 merge 到 dev 了 |
ok,那我就先不动这个 branch 了?dev 新更新的部分也需要加上深色样式 |
我刚刚重新发送了一下到 cldxiang@qq.com |
fix #46
新增
public/index.html
的<head>
中增加了一段脚本,从 localStorage 或系统默认深色模式配置初始化页面深色模式状态darkMode
Switcher 的dispatch
逻辑中,在用户主动触发切换时写入 localStorage 并切换当前 document 的dark
类名useDarkMode
Hook,在 store 中进行管理,第一次进入应用会继承系统深色模式设定。dark
类名dark:
配置深色模式样式“Buy me a coffee” Modal,因为有浅色底二维码图片,如果需要的话需要另外弄一张深色底二维码图片再进行适配额外工作
.vscode/settings.json
添加了"css.validate": false
,因为本项目引入了 TailwindCSS,在 TailwindCSS 官方插件文档 中建议去掉原生的 CSS 检查以支持如@apply
等语法待讨论