Skip to content

incompatible-theme-value

Reports a theme token with a value of the wrong type for its namespace, such as a length for a color.

This rule reports a theme token whose value does not match the type of its namespace. For example, tokens in --color-* must be colors, so a length makes bg-brand and the other color utilities write an invalid value.

Reported

@theme {
  --color-brand: 1rem;incompatible-theme-value: `1rem` is not a valid value for `--color-brand` because tokens of `--color-*` must be `color`
}

Fixed

@theme {
  --spacing-brand: 1rem;
}

How to fix

  • If the value is right, move the token to the namespace of that type, such as --spacing-* for a length, as in the example.
  • If the namespace is right, correct the value, such as a color for --color-*.

Rule settings

PresetSeverity
recommendeddeny
strictdeny
stylisticoff

Configure lint to change the severity or options.