Modules stop choosing colors. They name what they need, such as “card edge”, and say which shared colour it should follow. The site decides the rest, for every theme and every mode, in one place.
- The module labels its parts. “Card edge: follow the house border colour.” The module ships no colour values, so it can’t clash with any theme.
- The site picks the colors. In one place, per theme. Change the house border colour once and every module that follows it changes. Change “card edge” and only the card changes.
- Drupal writes a colour chart for each theme. Every label gets its final colour for light, dark and high contrast, worked out ahead of time.
- The browser reads the chart. A dark sidebar on a light page reads the dark column. Nothing reloads and Drupal does no extra work.
Why “stays a reference” is the important ask of core
If core resolved {color.border.default} when it discovered the module’s token file, the card would be frozen to the default gray. Then when an author changed the house border colour to navy, the card would ignore it. A mapping must stay a pointer until Drupal resolves it per theme and mode. That is what “runtime reference” means here, and what the project asks of core in issue #3590100.