Skip to content

[css-color-6] Parameter for font size in contrast-color()? #6319

@LeaVerou

Description

@LeaVerou

The current grammar for the target contrast ratio is:

to [<number> | AA | AA-large | AAA | AAA-large]

This requires authors to know when to apply *-large and when not to. Given that these are expressed in pt, that requires a fair bit of mental gymnastics.

I was wondering if something like this would be better:

to [ <number> | [AA | AAA] [for <length>]? ]

Where <length> defaults to 1em.

(Let's please not have a discussion about the potential future contrast algorithms in WCAG 3. We can cross that bridge when we get to it, and both syntaxes allow for future expansion)

Metadata

Metadata

Assignees

No one assigned

    Labels

    a11y-trackerGroup bringing to attention of a11y, or tracked by the a11y Group but not needing response.css-color-6i18n-trackerGroup bringing to attention of Internationalization, or tracked by i18n but not needing response.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions