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(manifest): do not use nuxt loading bar color as default theme_color #344

Merged
merged 3 commits into from
Oct 1, 2020

Conversation

maybebot
Copy link
Contributor

Fixes issue #223

Removes the defaults for the meta theme-color and the manifest theme-color taken from the nuxt loading bar.

To keep user configuration to a minimum, the manifest theme-color's default is now the meta one, if set.
In most real world scenarios they tend to coincide.

Docs updated to reflect the changes, plus a minor fix to the icon/meta links.

@maybebot maybebot changed the title Dev fix(theme-color): new defaults for theme-colors, not depeding on nuxt loading bar Sep 10, 2020
@@ -32,7 +32,7 @@ pwa: {
| `start_url` <sup>\*1</sup> | `String` | `routerBase + '?standalone=true'` | It has to be relative to where the manifest is placed |
| `display` <sup>\*1</sup> | `String` | `'standalone'` | |
| `background_color` <sup>\*2</sup> | `String` | `'#ffffff'` | |
| `theme_color` <sup>\*2</sup> | `String` | `this.options.loading.color` | Nuxt [loading color] option |
| `theme_color` <sup>\*2</sup> | `String` | `this.options.pwa.meta.theme_color` | This module's meta theme-color (see the [meta module]) |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think mentioning this.options.* is not necessary as theme_color can be set same as rest in table. We only removed default

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since these are the default options of the manifest, I thought it would be worth mentioning that it will have a default value from the PWA meta module's theme-color. If the docs say it's undefined but then has a value, even when not set, it might be confusing. What do you think?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the docs say it's undefined but then has a value, even when not set, it might be confusing. What do you think?

Yes this completely makes sense. We could just simplify content (see 4669426)

@@ -27,15 +27,15 @@ function addManifest (pwa) {
start_url: routerBase + '?standalone=true',
display: 'standalone',
background_color: '#ffffff',
theme_color: this.options.loading && this.options.loading.color,
theme_color: this.options.pwa.meta.theme_color,
lang: 'en',
useWebmanifestExtension: false,
fileName: 'manifest.[hash].[ext]'
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe here we can delete theme_color property if it is falsy?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JSON.stringify removes it when undefined for the manifestSource, but it is present in this.options.manifest as undefined. I can remove it with something like:

delete manifest.theme_color ? null : manifest.theme_color
or
if (!manifest.theme_color) { delete manifest.theme_color }

Sorry, I'm new to contributing to open source, and trying to get it right :) And thank you for the comments

@pi0 pi0 changed the title fix(theme-color): new defaults for theme-colors, not depeding on nuxt loading bar fix(manifest): do not use nuxt loading bar color as default theme_color Sep 10, 2020
@pi0 pi0 merged commit 6901b81 into nuxt-community:dev Oct 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants