微信小程序自适配DarkMode
主要是app.js里面配置。
{
"pages":[
"index/index"
],
"darkmode": true,
"themeLocation": "theme.json",
"window": {
"backgroundTextStyle": "@backgroundTextStyle",
"navigationBarBackgroundColor": "@navBackgroundColor",
"navigationBarTitleText": "天下码农-码农天下",
"navigationBarTextStyle": "@navTextStyle"
},
"style": "v2",
"sitemapLocation": "sitemap.json"
}
然后在css里面加上darkmode的适配代码即可。
demo下载:
(21条消息) 微信自适应深色主题(darkmode)/浅色模式源码_pc微信深色-小程序文档类资源-CSDN文库
https://download.csdn.net/download/lqldir/19265740?spm=1001.2014.3001.5503