Skip to content

Validator does not recognize "background-color" and "fill" properties with custom values #421

Closed
@tylerjmorg

Description

@tylerjmorg

It looks like the validator does not recognize custom property values with the "background-color" and "fill" properties.

Consider the following example:

CSS:
:root { --primary-color: light-dark(#000,#fff); } ... body { background-color: var(--primary-color); }

or

:root { --primary-color: light-dark(#000,#fff); } ... body { fill: var(--primary-color); }

The validator displays the following:

Value Error : background-color [var(--primary-color)] is not a [background-color] value : [var(--primary-color)]

or

[var(--primary-color)] is not a [fill] value : [var(--primary-color)]

Although, it looks like the "background-color" property is used as an example in the W3C standard.

Standard (CR): https://www.w3.org/TR/css-variables-1/
Standard (Editor's Draft): https://drafts.csswg.org/css-variables/

You can also test the examples with https://tylermorgan.co/ in the validator.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions