Skip to content
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

黑暗模式刷新会闪白,闪瞎眼 #912

Open
pdbsdk opened this issue Mar 14, 2024 · 2 comments
Open

黑暗模式刷新会闪白,闪瞎眼 #912

pdbsdk opened this issue Mar 14, 2024 · 2 comments

Comments

@pdbsdk
Copy link

pdbsdk commented Mar 14, 2024

有什么办法解决吗?我没睡觉研究了一通宵解决不了。

@pdbsdk
Copy link
Author

pdbsdk commented Mar 14, 2024

@appotry
好兄弟,靠你了!我看你的博客不会闪白。

@appotry
Copy link
Contributor

appotry commented Mar 16, 2024

后来修改代码,使用另一种方式实现的黑暗模式,改动非常大,css整个采用媒体查询,网页加载时查询localstorage 内是黑还是白

原来的代码实现方式相当于外挂css, js 来翻转黑白。 把js控制逻辑提前运行,放到header里面试试

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants