We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
config.sys.dweb
window.std
原因:用来监听用户设备的主题颜色改变,来适配light/dark。 开发者可以监听到改变的时候改变自己app的主题颜色,来提供更好的体验。
light/dark
export enum ThemeStatus { Light, Dark } configPlugin..addEventListener("ThemeSwitch", (event)=> { const status:ThemeStatus = event.data })
The text was updated successfully, but these errors were encountered:
目前要监听主题是否改变,只能的方案是:
所以如果真的有这个需求,我觉得也应该由 window.std 出发去实现,去进行查询。 比方说:
GET window.std.web/query/media/prefers-color-scheme => 'dark'|'light'
包括目前 config 中的 setLang 也是同样的,应该迁移到 window.std 中去实现。 开发者需要面对的是自己的窗口内容的配置,而不是去在乎操作系统的配置。因为窗口内容是 内容提供者(开发方) 和 用户设置 最终下来的结果。 比方说:
GET window.std.web/query/languages => { selected: 'zh', options: ['zh', 'en'] }
同样的,也应该提供监听功能:
GET window.std.web/watch/media/prefers-color-scheme => event: changed\ndata: dark
参考资料:
Sorry, something went wrong.
切换目标 移除 config.sys.dweb 按照上面的行动。
No branches or pull requests
原因:用来监听用户设备的主题颜色改变,来适配
light/dark
。开发者可以监听到改变的时候改变自己app的主题颜色,来提供更好的体验。
The text was updated successfully, but these errors were encountered: