提交 98df378a 编写于 作者: D DCloud_LXH

fix(app): darkmode

上级 7f45e824
......@@ -127,7 +127,7 @@ export function getDevServerOptions(manifestJson: Record<string, any>) {
export function getPlatformManifestJsonOnce() {
const platform =
process.env.UNI_PLATFORM === 'app-plus' ? 'app' : process.env.UNI_PLATFORM
process.env.UNI_PLATFORM === 'app' ? 'app-plus' : process.env.UNI_PLATFORM
return !process.env.UNI_INPUT_DIR
? {}
: parseManifestJsonOnce(process.env.UNI_INPUT_DIR)[platform] || {}
......
......@@ -108,12 +108,14 @@ function darkmodeAtRule(root: Root, platform: UniApp.PLATFORM) {
)
if (backgroundColor !== 'undefined') {
const mediaRoot = postcss.parse(`
/* #ifndef APP-NVUE*/
@media (prefers-color-scheme: ${theme}) {
body,
uni-page-body {
background-color: ${backgroundColor};
}
}
/* #endif */
`)
root.nodes = [...mediaRoot.nodes, ...root.nodes]
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册