Skip to content

Build error when using --color-*: initial theme reset in Tailwind CSS v4 #63

@jeniabrook

Description

@jeniabrook

Description

When using Tailwind CSS v4's theme reset feature to override default color values with --color-*: initial;, the build fails with a TypeError.

Error

TypeError: Cannot use 'in' operator to search for '__CSS_VALUES__' in undefined

Environment

  • Tailwind CSS: v4.1.17
  • tailwindcss-motion: v1.1.1
  • Build tool: @tailwindcss/cli

Reproduction

@import "tailwindcss";

@plugin "tailwindcss-motion";

@theme inline {
  --color-*: initial;  /* This line causes the error */
  --spacing-*: initial;
  --radius-*: initial;
  --text-*: initial;
  --font-weight-*: initial;
  --drop-shadow-*: initial;
  --breakpoint-*: initial;
  
  /* Custom theme values follow... */
}

Running @tailwindcss/cli with the above CSS produces the error.

Workaround

Commenting out only --color-*: initial; allows the build to succeed. All other namespace resets (--spacing-*, --radius-*, etc.) work fine.

@theme inline {
  /* --color-*: initial; */  /* Commenting this out fixes the issue */
  --spacing-*: initial;
  /* ... */
}

Expected Behavior

The plugin should work with Tailwind CSS v4's theme reset feature, or gracefully handle cases where default theme values are reset.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions