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

暗色模式在首次访问时产生闪动 #291

Closed
Enter-tainer opened this issue Jun 16, 2020 · 1 comment
Closed

暗色模式在首次访问时产生闪动 #291

Enter-tainer opened this issue Jun 16, 2020 · 1 comment
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@Enter-tainer
Copy link
Member

由于 js 会在 html 之后加载,因此写在 js 中的暗色模式的相关逻辑往往会在网页元素显示出来之后才能得到加载。而在进行服务端渲染时,默认的主题是亮色主题。因此,如果用户设置了暗色模式,在首次访问的时候,会先看到亮色的页面,然后在 js 加载完毕后才会变成暗色。

解决这个问题,需要在页面的头部加载一个较为轻量的 js 来处理暗色模式的相关逻辑。

@Enter-tainer Enter-tainer added enhancement New feature or request help wanted Extra attention is needed labels Jun 16, 2020
@diauweb
Copy link
Member

diauweb commented Jun 19, 2020

#205

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants