Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: allow turning off theme color tags #5820

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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