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

移动端夸克浏览器适配问题 #477

Closed
2 of 3 tasks
L33Z22L11 opened this issue May 30, 2024 · 5 comments
Closed
2 of 3 tasks

移动端夸克浏览器适配问题 #477

L33Z22L11 opened this issue May 30, 2024 · 5 comments

Comments

@L33Z22L11
Copy link
Contributor

检查清单

  • 已经阅读过 官方文档 相关内容,并尝试进行搜索。
  • 尝试过在本地测试运行官方 demo 源码。
  • 尝试过在 Codespace 中测试运行官方 demo 源码。

问题描述

夸克APP和Edge对比

经过调试检测,发现是夸克端不支持深色模式。

代码中有大量 @media (prefers-color-scheme: light),希望移除这些媒体查询,或者设置 @media (prefers-color-scheme: no-preference) 对应的样式。

另外参见 f36e6b9 的评论。

L33Z22L11 added a commit to L33Z22L11/hexo-theme-stellar that referenced this issue May 30, 2024
@xaoxuu
Copy link
Owner

xaoxuu commented May 30, 2024

因为写法不统一造成部分内容用了深色的方案?

@L33Z22L11
Copy link
Contributor Author

是「什么方案都没用」

L33Z22L11 added a commit to L33Z22L11/hexo-theme-stellar that referenced this issue May 30, 2024
@L33Z22L11
Copy link
Contributor Author

L33Z22L11 commented May 30, 2024

一部分浏览器根本不认 prefers-color-scheme 媒体特性,例如这段代码对于夸克APP根本不生效:

@media (prefers-color-scheme: no-preference) {
  * {
    background: red;
  }
}

@media (prefers-color-scheme: light) {
  * {
    background: green;
  }
}

@media (prefers-color-scheme: dark) {
  * {
    background: blue;
  }
}

再比如一些注重隐私的浏览器为了防止跟踪,也不会报告自己的 prefers-color-scheme

因此我建议将明亮模式作为不支持媒体特性的默认值,深色模式再单独处理。

@xaoxuu
Copy link
Owner

xaoxuu commented May 30, 2024

我是要将明亮模式作为不支持媒体特性的默认值的,应该怎样改呢

@L33Z22L11
Copy link
Contributor Author

L33Z22L11 commented May 30, 2024

#478 ,这是成本最低且兼容性最好的修复方式,经简单检测不会影响主题目前和未来的样式。我观察到其他博客/网站也使用的这种方案。

xaoxuu pushed a commit that referenced this issue May 30, 2024
* [fix] #477 bad appearence with no prefers-color-scheme

* [fix] safari status bar
lliei0x pushed a commit to lliei0x-x/hexo-theme-stellar that referenced this issue Aug 21, 2024
)

* [fix] xaoxuu#477 bad appearence with no prefers-color-scheme

* [fix] safari status bar
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