Skip to content
This repository has been archived by the owner on May 2, 2024. It is now read-only.

Commit

Permalink
fix(meta): ability to opt-out theme_color property
Browse files Browse the repository at this point in the history
Fixes #53
  • Loading branch information
kevinmarrec committed Oct 22, 2022
1 parent e637b0f commit ee3070e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
9 changes: 5 additions & 4 deletions src/parts/meta/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,11 @@ export default (pwa: PWAContext) => {
head.meta.push({ name: 'description', content: options.description })

// Theme Color
const themeColor = pwa.meta.theme_color || (pwa.manifest && pwa.manifest.theme_color)

if (themeColor)
head.meta.push({ name: 'theme-color', content: themeColor })
if (options.theme_color !== false) {
const themeColor = pwa.meta.theme_color || (pwa.manifest && pwa.manifest.theme_color)
if (themeColor)
head.meta.push({ name: 'theme-color', content: themeColor })
}

// Lang
if (options.lang) {
Expand Down
20 changes: 10 additions & 10 deletions src/parts/meta/types.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
export interface MetaOptions {
name: string
author: string
description: string
author: string | false
description: string | false
favicon: boolean
mobileApp: boolean
mobileAppIOS: boolean
appleStatusBarStyle: boolean
theme_color: string | undefined
lang: string
ogType: string
ogSiteName: boolean | string
ogTitle: boolean | string
ogDescription: boolean | string
ogImage: boolean | string | { path: string; width?: number; height?: number; type?: string }
theme_color: string | false | undefined
lang: string | false
ogType: string | false
ogSiteName: string | boolean
ogTitle: string | boolean
ogDescription: string | boolean
ogImage: string | boolean | { path: string; width?: number; height?: number; type?: string }
ogHost: string | undefined
ogUrl: boolean | string
ogUrl: string | boolean
twitterCard: string | undefined
twitterSite: string | undefined
twitterCreator: string | undefined
Expand Down

0 comments on commit ee3070e

Please sign in to comment.