Skip to content

Commit

Permalink
fix: allow turning off theme color tags (#5820)
Browse files Browse the repository at this point in the history
Co-authored-by: Haoqun Jiang <haoqunjiang@gmail.com>
  • Loading branch information
GabrielGMartinsBr and sodatea committed Aug 31, 2020
1 parent d88d927 commit 34b58c0
Showing 1 changed file with 18 additions and 11 deletions.
29 changes: 18 additions & 11 deletions packages/@vue/cli-plugin-pwa/lib/HtmlPwaPlugin.js
Expand Up @@ -111,13 +111,18 @@ module.exports = class HtmlPwaPlugin {
rel: 'manifest',
href: getTagHref(publicPath, manifestPath, assetsVersionStr)
}
),
makeTag('meta', {
name: 'theme-color',
content: themeColor
})
)
)

if (themeColor != null) {
data.head.push(
makeTag('meta', {
name: 'theme-color',
content: themeColor
})
)
}

// Add to home screen for Safari on iOS
data.head.push(
makeTag('meta', {
Expand Down Expand Up @@ -154,12 +159,14 @@ module.exports = class HtmlPwaPlugin {
content: getTagHref(publicPath, iconPaths.msTileImage, assetsVersionStr)
}))
}
data.head.push(
makeTag('meta', {
name: 'msapplication-TileColor',
content: msTileColor
})
)
if (msTileColor != null) {
data.head.push(
makeTag('meta', {
name: 'msapplication-TileColor',
content: msTileColor
})
)
}

cb(null, data)
})
Expand Down

0 comments on commit 34b58c0

Please sign in to comment.