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

[Bug?]: Meta tags with the same name, but different props are merged and only the last on his rendered #1036

Closed
2 tasks done
coppy-team opened this issue Aug 30, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@coppy-team
Copy link

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Current behavior 😯

If I'm trying to add several meta tags with the same name, only the last one is rendered:

<Meta
    name="theme-color"
    content="hsl(215 30% 96%)"
    media="(prefers-color-scheme: light)"
/>
<Meta
    name="theme-color"
    content="hsl(215 15% 20%)"
    media="(prefers-color-scheme: dark)"
/>

On the html page I see only the last meta tag:

<meta name="theme-color" content="hsl(215 15% 20%)"  media="(prefers-color-scheme: dark)" >

Expected behavior 🤔

It seems like this might be an expected behavior and we usually want to merge those tags. But in this case we want to keep both tags, because they use different media queries.

I think tangential issue is that typing for Meta component (and meta tag) do not expect the media attribute.

Steps to reproduce 🕹

No response

Context 🔦

I'm trying to set up the color for the Safari tab bar. And I want to set different color depending on the user selected theme.

Your environment 🌎

No response

@coppy-team coppy-team added the bug Something isn't working label Aug 30, 2023
@ryansolid
Copy link
Member

I believe this was fixed in latest Solid Meta.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants