当前位置:网站首页>H5内嵌App适配暗黑模式
H5内嵌App适配暗黑模式
2022-07-05 06:23:00 【Heerey525】
情况:项目是vue
做的H5
页面,需要嵌入到App
中适配暗黑模式,但是H5需要有个加载的过程,就会出现一闪而过的白色(未渲染完成)
解决方法:在public/index.html
中添加CSS
媒体查询,代码如下
<style type="text/css">
@media (prefers-color-scheme: no-preference) {
body {
background-color: #fff !important;
}
}
@media (prefers-color-scheme: light) {
body {
background-color: #fff !important;
}
}
@media (prefers-color-scheme: dark) {
body {
background-color: rgba(0,0,0,28) !important;
}
}
</style>
边栏推荐
- 4. Oracle redo log file management
- JS quickly converts JSON data into URL parameters
- Sorting out the latest Android interview points in 2022 to help you easily win the offer - attached is the summary of Android intermediate and advanced interview questions in 2022
- Niu Mei's math problems
- Quickly use Amazon memorydb and build your own redis memory database
- Leetcode-6109: number of people who know secrets
- MySQL advanced part 1: View
- LeetCode-54
- Leetcode-22: bracket generation
- 博弈论 AcWing 893. 集合-Nim游戏
猜你喜欢
2.Oracle-数据文件的添加及管理
Find the combination number acwing 889 01 sequence meeting conditions
Leetcode-6108: decrypt messages
What is socket? Basic introduction to socket
MySQL advanced part 2: the use of indexes
[2020]GRAF: Generative Radiance Fields for 3D-Aware Image Synthesis
Suppose a bank's ATM machine, which allows users to deposit and withdraw money. Now there is 200 yuan in an account, and both user a and user B have the right to deposit and withdraw money from this a
4. Object mapping Mapster
P2575 master fight
求组合数 AcWing 887. 求组合数 III
随机推荐
[rust notes] 16 input and output (Part 2)
Leetcode-6111: spiral matrix IV
Paper reading report
4. Oracle redo log file management
Sum of three terms (construction)
1.15 - input and output system
Is it impossible for lamda to wake up?
2022/6/29-日报
Presentation of attribute value of an item
Quickly use Amazon memorydb and build your own redis memory database
P3265 [jloi2015] equipment purchase
栈 AcWing 3302. 表达式求值
Find the combination number acwing 887 Find combination number III
our solution
博弈论 AcWing 893. 集合-Nim游戏
Leetcode recursion
如何正确在CSDN问答进行提问
4. Object mapping Mapster
Leetcode array operation
C Primer Plus Chapter 15 (bit operation)