当前位置:网站首页>H5 embedded app adapts to dark mode
H5 embedded app adapts to dark mode
2022-07-05 06:27:00 【Heerey525】
situation : The project is vue
It's done H5
page , It needs to be embedded in App
Medium to dark mode , however H5 There needs to be a loading process , There will be a flash of white ( Rendering is not complete )
resolvent : stay public/index.html
Add CSS
Media query , The code is as follows
<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>
边栏推荐
- our solution
- SQL三种连接:内连接、外连接、交叉连接
- TypeScript入门
- How to generate an image from text on fly at runtime
- Nested method, calculation attribute is not applicable, use methods
- 2022 winter vacation training game 5
- TCP's understanding of three handshakes and four waves
- What's wrong with this paragraph that doesn't work? (unresolved)
- Currently clicked button and current mouse coordinates in QT judgment interface
- [leetcode] day95 effective Sudoku & matrix zeroing
猜你喜欢
Idea debug failed
International Open Source firmware Foundation (osff) organization
将webApp或者H5页面打包成App
4. 对象映射 - Mapping.Mapster
MySQL advanced part 1: stored procedures and functions
MySQL advanced part 2: optimizing SQL steps
Vant Weapp SwipeCell设置多个按钮
Leetcode array operation
Interval problem acwing 906 Interval grouping
ollvm编译出现的问题纪录
随机推荐
AE tutorial - path growth animation
Find the combination number acwing 888 Find the combination number IV
1.手动创建Oracle数据库
H5 模块悬浮拖动效果
vsCode创建自己的代码模板
What's wrong with this paragraph that doesn't work? (unresolved)
Dataframe (1): introduction and creation of dataframe
中国剩余定理 AcWing 204. 表达整数的奇怪方式
MySQL怎么运行的系列(八)14张图说明白MySQL事务原子性和undo日志原理
TCP's understanding of three handshakes and four waves
What is socket? Basic introduction to socket
MPLS experiment
将webApp或者H5页面打包成App
Leetcode array operation
Basic explanation of typescript
5. Oracle tablespace
Stack acwing 3302 Expression evaluation
在新线程中使用Handler
Design specification for mobile folding screen
Chart. JS - Format Y axis - chart js - Formatting Y axis