Skip to content

T2109: Contrast pairing cannot be checked ​

Cause ​

The contract pairs two parts for a contrast check, but the style does not set a color or background token on one of them, so the pairing cannot be checked.

Example ​

xml
<contract>
{ "name": "Card", "role": "group", "parts": ["root", "label"], "contrast": [{ "foreground": "label", "background": "root" }] }
</contract>
<template><div class="root"><span class="label"></span></div></template>
<style>
.root { padding: $space.2; }
.label { padding: $space.1; }
</style>

What you see ​

text
WARNING  T2109  app/components/Card.tess:5:8
  The contract pairs "label" text with a "root" background, but .label sets no color token, so the pairing cannot be checked.
  Set the missing token in <style>, or remove the pairing from the contract.
  Run `tessera explain T2109` for details.

Fix ​

Set the missing token in <style>, or remove the pairing from the contract.

All errors and warnings