Skip to content

fix(theme): blank top-level base in applyUnstyled - #6825

Merged
benjamincanac merged 1 commit into
v4from
fix/unstyled-base
Aug 11, 2026
Merged

fix(theme): blank top-level base in applyUnstyled#6825
benjamincanac merged 1 commit into
v4from
fix/unstyled-base

Conversation

@benjamincanac

Copy link
Copy Markdown
Member

🔗 Linked issue

Relates to #6551

❓ Type of change

  • 📖 Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

applyUnstyled only blanks slots, variants and compoundVariants. Themes come in two shapes: multi-element components put their classes under slots, single-element ones are a top-level base string (or array). There's no base branch, so with theme.unstyled enabled the 37 base-shaped themes (skeleton, kbd, container, main, the prose elements, ...) come out identical to the original and keep every class, while everything slots-shaped is blanked. The docs promise the option removes the default classes from all components at once, so this is a plain hole.

While in there, applyUnstyled no longer mutates the theme it receives: object-shaped themes are the shared module export (function-shaped ones produce a fresh object per call), so blanking in place corrupts every later read within the same process.

Covered by unit tests for both fixes. #6731 blanks unused component themes through this same function, so it picks this up on its next v4 merge.

📝 Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@github-actions github-actions Bot added the v4 #4488 label Aug 11, 2026
@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: da72ec40-4645-449b-a3bc-fb8d6fc12d79

📥 Commits

Reviewing files that changed from the base of the PR and between 80cad10 and b385796.

📒 Files selected for processing (2)
  • src/utils/theme.ts
  • test/utils/theme.spec.ts

📝 Walkthrough

Walkthrough

applyUnstyled now shallow-copies theme results before applying blanking changes. It clears top-level base classes for single-element components. Tests cover string and array base values and verify that object-shaped themes are not mutated.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the primary fix: blanking top-level base values in applyUnstyled.
Description check ✅ Passed The description directly explains both fixes and identifies the related tests and issue.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/unstyled-base

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

src/utils/theme.ts

Parsing error: Unexpected token :


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codspeed-hq

codspeed-hq Bot commented Aug 11, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 31 untouched benchmarks


Comparing fix/unstyled-base (b385796) with v4 (80cad10)

Open in CodSpeed

@pkg-pr-new

pkg-pr-new Bot commented Aug 11, 2026

Copy link
Copy Markdown
npm i https://pkg.pr.new/@nuxt/ui@6825

commit: b385796

@benjamincanac
benjamincanac merged commit 3e89ea7 into v4 Aug 11, 2026
26 checks passed
@benjamincanac
benjamincanac deleted the fix/unstyled-base branch August 11, 2026 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v4 #4488

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant