Comments (9)
基于chromium的浏览器似乎都存在此问题(Linux不兼容)
测试了一下Edge [ Version 100.0.1185.29 (Official build) (64-bit) ],同样不支持亮暗色识别(默认总是亮的)
https://bugs.chromium.org/p/chromium/issues/detail?id=998903
相关代码:
window.matchMedia("(prefers-color-scheme)")
window.matchMedia("(prefers-color-scheme:dark)")
window.matchMedia("(prefers-color-scheme:light)")
可能的处理方案
虽然目前浏览器不支持,但可以间接实现。
执行如gsettings get org.gnome.desktop.interface gtk-theme
这样的命令来获取主题的亮暗。
使用上方代码指令替换(prefers-color-scheme)
相关的查询语句,这样可以实现目的;
但是,这个实现比较复杂,因为Linux的桌面不是只有一个;
有dde
、gnome
、kde
等,这些桌面的查询方式都不一样。
结论
暂不处理
edit: 考虑到deepin,也使用了gtk的操作,就准备处理,有不兼容再加上
补充
edit: 参考:https://wiki.archlinux.org/title/Dark_mode_switching
deepin
deepin获取当前主题:
gsettings get com.deepin.dde.appearance gtk-theme
gsettings get com.deepin.xsettings theme-name
相关脚本
#!/bin/bash
for scheme in $(gsettings list-schemas | grep deepin);
do
echo "=====$scheme====="
gsettings list-keys $scheme | grep theme
done
gnome
gnome获取当前主题:
gsettings get org.gnome.desktop.interface gtk-theme
from wechat-web-devtools-linux.
https://github.com/msojocs/wechat-web-devtools-linux/releases/tag/continuous
from wechat-web-devtools-linux.
请尝试最新的continuous版本是否符合预期
from wechat-web-devtools-linux.
辛苦了,一会就测
from wechat-web-devtools-linux.
貌似重新构建后在gnome不起作用
可能是我姿势问题,正在下载action的自动构建里的aur包
from wechat-web-devtools-linux.
已找到问题所在, 在 gnome
下很多第三方GTK主题都是以 Dark
结尾标明暗色的, 由于我使用了 Flat-Remix-Theme
所以会导致没能切换....这个处理起来相对容易
另外在 gnome42
的环境下, 已经官方支持了亮暗色主题...可以通过
$ gsettings get org.gnome.desktop.interface color-scheme
判断该值是否为 prefer-dark
来更准确的判断是否处于暗色模式!
from wechat-web-devtools-linux.
感谢提交PR
新的continuous版本已完成构建
from wechat-web-devtools-linux.
感谢, 经测试 continuous 版本主题跟随系统已可用!
但是在aur的构建脚本当中, nwjs
和 nodejs
版本, 还未得到更新...
from wechat-web-devtools-linux.
好的,感谢测试
aur脚本会进行跟进的。
from wechat-web-devtools-linux.
Related Issues (20)
- docker-compose up失败: cp: cannot stat '/workspace/compiler/wcc_node/bin': No such file or directory HOT 2
- [兼容性问题] 部分node模块无法在Linux下使用 HOT 4
- Manjaro下直接安装zst包,编译项目时报错:no such file or directory, stat '/opt/wechat-devtools/nwjs/package.nw/node_modules/wcc-exec' HOT 3
- lazyCodeLoading: 'requiredComponents'配置项会导致小程序白屏 HOT 1
- 打开项目后,弹窗提示:couldn't start client skyline style server HOT 1
- aur 编译问题 HOT 1
- 部分中文显示为方块 HOT 4
- [已启用] 基于CPP的Linux原生编译器 HOT 5
- iOS真机调试一直是白屏,开发者工具里Wxml里是空白的 HOT 2
- 华为银河麒麟系统,linux的arm64架构下构筑失败 HOT 1
- ubuntu 22.04 有bug
- 赞赏 backup
- useExtendedLib (weui) 无法使用 HOT 3
- [skyline] 此功能不可使用的一些说明 HOT 1
- 编译报错 HOT 2
- 编译问题,无法编译WXSS文件 HOT 11
- 报错了,但是windows的开发者工具打开同一个项目是没有报错的 HOT 4
- fedora38 界面乱码 HOT 5
- manjaro kde下安装报错 HOT 3
- 使用appImage打开后,控制台报错$gwx is not defined HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wechat-web-devtools-linux.