Skip to content

[css-font-loading] [info discovery] iterable doesn't tell you what index you are at #6593

@litherum

Description

@litherum

One natural use case use case of the information discovery facilities in css-font-loading would be "I want to swap the green color in my palette to my custom color." Doing this requires 2 steps:

  1. Iterating over the colors in the palette until you find green
  2. Creating a @font-palette-values rule that maps the index of green to your new custom color

The trick here is the "index" of green. When you iterate through an iterable, it doesn't tell you what index you're at. So, if you want to determine what index green lies at, you have to track that yourself.

You can do this with a 3-clause for loop, and getter, but maybe we can do better here.

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