这是indexloc提供的服务,不要输入任何密码
Skip to content

[Bug] meta-theme-color incorrectly triggers when two theme-color tags use different media queries #6001

@quisido

Description

@quisido

🐞 Bug report

Description

I have a theme color for prefers dark and prefers light color schemes. Webhint flags this as invalid.

    <meta name="theme-color" media="(prefers-color-scheme: dark)"
      content="#13171a" />
    <meta name="theme-color" media="(prefers-color-scheme: light)"
      content="#f8f4f0" />
A 'theme-color' meta element is not needed as one was already specified.
[meta-theme-color](https://webhint.io/docs/user-guide/hints/hint-meta-theme-color/)

Details

MDN resource for defining separate theme colors per user preference:

https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/meta/name/theme-color#using_a_media_query_with_theme-color

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions