Skip to content

chore: Update cva to 1.0-beta#5098

Open
sebald wants to merge 24 commits intomainfrom
cva-update-ui
Open

chore: Update cva to 1.0-beta#5098
sebald wants to merge 24 commits intomainfrom
cva-update-ui

Conversation

@sebald
Copy link
Member

@sebald sebald commented Feb 4, 2026

Description

Migrate from class-variance-authority to cva (v1 beta) and simplify extendTheme via function composition.

Key changes:

  • Replace class-variance-authority dependency with cva v1 beta, which has built-in Tailwind merge support via
    defineConfig
  • Refactor the custom cva wrapper in className.utils.ts to use cva's defineConfig with a twMerge hook,
    removing ~40 lines of manual type definitions and wrapper code
  • Simplify extendTheme to compose style functions directly (cn(existingFn(props), newFn(props))) instead of
    extracting and merging variant configs — this fixes a bug where defaultVariants and compoundVariants were lost
    during merging
  • Update all theme style files in theme-docs and theme-rui to the new cva API (object config with
    base/variants/compoundVariants keys)
  • Remove exported internal types (ConfigSchema, ConfigVariants, ConfigVariantsMulti, Config, Props) that are
    no longer needed — only ClassValue and VariantProps remain
  • Update docs and fumadocs build scripts and demos to align with the new API

Test Instructions:

  1. Run pnpm build to verify all packages build successfully
  2. Run pnpm test:unit to verify unit tests pass
  3. Run pnpm sb and verify components render correctly with their variants in Storybook
  4. Verify extendTheme works correctly — defaultVariants and compoundVariants should now be preserved when
    extending a theme

Reviewers:

@marigold-ui/developer

Pull Request Checklist:

  • Marigold docs and Storybook Preview is available
  • Added/updated unit tests and storybook for this change (for new code or code which already has tests).
  • Added/Updated documentation (if it already exists for this component).
  • Updated visual regression tests (only necessary when ui changes in the PR)

@changeset-bot
Copy link

changeset-bot bot commented Feb 4, 2026

🦋 Changeset detected

Latest commit: 42036da

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 7 packages
Name Type
@marigold/system Minor
@marigold/theme-docs Minor
@marigold/theme-rui Minor
@marigold/docs Minor
fumadocs Patch
@marigold/components Minor
@marigold/icons Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Feb 4, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
marigold-docs Ready Ready Preview, Comment Feb 13, 2026 8:29am
marigold-fumadocs Ready Ready Preview, Comment Feb 13, 2026 8:29am
marigold-storybook Ready Ready Preview, Comment Feb 13, 2026 8:29am
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
marigold-production Ignored Ignored Feb 13, 2026 8:29am

Request Review

@sebald sebald changed the title chore: Update cva to `1.0-beta chore: Update cva to 1.0-beta Feb 6, 2026
@github-actions github-actions bot added type:docs Improvements or additions to documentation type:feature New feature or component labels Feb 6, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Feb 6, 2026

Coverage Report for Marigold Code Coverage

Status Category Percentage Covered / Total
🔵 Lines 96.78% 1414 / 1461
🔵 Statements 96.31% 1465 / 1521
🔵 Functions 94.78% 400 / 422
🔵 Branches 89.76% 903 / 1006
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/system/src/hooks/extendTheme.tsx 100% 100% 100% 100%
packages/system/src/utils/className.utils.ts 100% 100% 100% 100%
Generated in workflow #19520 for commit 42036da by the Vitest Coverage Report Action

@github-actions
Copy link
Contributor

github-actions bot commented Feb 6, 2026

Accessibility tests executed. Download the report here.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 6, 2026

Accessibility tests executed. Download the report here.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 7, 2026

Accessibility tests executed. Download the report here.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 7, 2026

Accessibility tests executed. Download the report here.

@github-actions
Copy link
Contributor

Accessibility tests executed. Download the report here.

@github-actions
Copy link
Contributor

Accessibility tests executed. Download the report here.

@github-actions
Copy link
Contributor

Accessibility tests executed. Download the report here.

@github-actions
Copy link
Contributor

Accessibility tests executed. Download the report here.

@github-actions
Copy link
Contributor

Accessibility tests executed. Download the report here.

@github-actions
Copy link
Contributor

Accessibility tests executed. Download the report here.

@github-actions
Copy link
Contributor

Accessibility tests executed. Download the report here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:docs Improvements or additions to documentation type:feature New feature or component

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant