Skip to content

[css-conditional][css-values] Allow setting type for style() condition comparisons #12330

Open
@mirisuzanne

Description

@mirisuzanne

The style() condition in @container and if() behaves differently depending on the type of the custom property being queried. If --color is registered with the <color> syntax, and --token is not, but both are assigned the red value, then style(--color: #f00) will be true, and style(--token: #f00) will be false.

Ideally, authors should be able to assign a type for the condition instead of relying on the registration of individual properties. I raised this on a separate issue about function parameter types, and @tabatkins suggested --foo as <type>: val for a syntax. This should also work in a range syntax: 10px < --foo as <length> < 20px.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions