-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
[gatsby-plugin-manifest] Add option to remove theme-color meta tag #9977
Comments
This would be a great first PR! Would you be interested in making the changes? Whether you are or not, I can walk through how someone would make the changes. Feature Request: Allow disabling of theme-color from meta-tagIn some scenarios, it may make sense to disable the automatic meta What's involved
Technical Detail
|
Thanks for the quick reply! I'll put together a PR when I get a moment. |
Didn't mean to steal your thunder here @GriffinJohnston, I can rescind this PR if you were indeed currently working on this. Just thought it might be nice to bang it out and get on to the next one! |
@DZuz14 Not at all! I got really busy soon after posting this and never got around to it. Glad you jumped on it! Edit: actually your PR doesn't address my issue! What I want is an option that still allows setting a theme_color (for the webmanifest) but doesn't output a theme color meta tag in the head of the site. Should be able to get to this over the weekend. |
There should be a way to make |
Haha whoops. So did my PR really accomplish anything? |
@pieh I was considering that, but there are plans to remove the use of data-react-helmet="true" from react-helmet, see nfl/react-helmet#79 @DZuz14 Not for my purposes! Haha. I wasn't sure if you were addressing a separate problem you had run into. |
That was still good sanity change - if
Yeah I saw this last year. It will be great once it's done, but it's not done yet. I feel like it would be easier for users to not care about that extra config option - problem with this is that they need to know about it - so scenario would be - they notice this problem of duplicated |
I agree that adding data-react-helmet="true" is a lot more elegant, but I worry about adding code that we know will be obsolete at some point in the near to medium term? Is there a system for flagging this kind of thing to make sure it gets updated once that change happens? |
Ah, I see the problem that you are having now. I would agree with @GriffinJohnston on this one. As long as this option was to be well documented with an explanation of why it's useful in some cases, I think we should have trust in the user to be resourceful enough to check the documentation if they do indeed experience any duplications. At least you will be future proofing the plugin to not depend on third party code that could change. |
Maybe the documentation for the plugin could prominently display a quick warning/tip for users who dynamically set theme colors in their app, with a link to that config option with a code example or something. |
@pieh I can try fixing this issue as my first Gatsby PR if you don't mind. What would be the best way to pass I was thinking about: theme_color: {
color: '#663399',
in_head: false
} but I decided against it because Maybe:
I'd gladly set some of my time to get this done if you want/need. |
@pieh My PR above fixes @GriffinJohnston's issue. I'm open to discussion & advice. |
@ivorpad that's great! We definitely need to leave As for naming the option - that's always the hard part ;) |
That name works! We could also use something like |
I'm the king of weird names for variables 😂 Open to suggestions, though. |
…it's not defiened (gatsbyjs#10069) Not really sure how I go about submitting a PR here. This addition references issue gatsbyjs#9977 Any guidance would be greatly appreciated.
Summary
gatsby-plugin-manifest inserts a theme-color meta tag into the site head. This means that you can't use React Helmet to set the theme_color, which is a problem for sites with a dark mode/theme-switcher/etc that want to programmatically change color schemes.
We could either remove the meta tag insertion entirely, since it's redundant with the theme_color value in the manifest, or — if the meta tag is required for some corner-cases I'm not aware of — add an option to turn off this behavior.
I'm just diving into Gatsby, and I've been super impressed so far. Thanks everyone for the hard work on this awesome project!
The text was updated successfully, but these errors were encountered: