Skip to content

SW14007: Malformed theme reference

A --theme() call in your stylesheet has invalid syntax.

This error occurs when a --theme() call in your stylesheet has invalid syntax, such as no token name.

Reported

.card {
  color: --theme();
}

SW14007: invalid --theme() reference at value byte 9667: invalid --theme() property `` at byte 0

Fixed

.card {
  color: --theme(--color-blue-500);
}

How to fix

Write the full name of a theme token, with an optional fallback after a comma, such as --theme(--color-brand, blue).

A valid reference to a token that the theme does not define is reported by invalid-theme-reference instead.