Skip to content

fix(prose): size inline code in headings without anchor links - #7291

Merged
benjamincanac merged 1 commit into
v4from
fix/prose-heading-code-size
Oct 26, 2026
Merged

benjamincanac merged 1 commit into
v4from
fix/prose-heading-code-size

Conversation

@benjamincanac

@benjamincanac benjamincanac commented Oct 26, 2026 •

Copy link
Copy Markdown
Member

🔗 Linked issue

❓ 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

Noticed this while trying Docus on Content v4 in nuxt-content/docus#1470. Content v4 no longer installs @nuxtjs/mdc, so mdc.headings.anchorLinks isn't set and inline code in an h2 or h3 rendered at the body text-sm size. The heading size and weight were only applied through [&>a>code], so they were lost once the code sits directly in the heading, which is the default since #6735.

This PR moves the size and weight to [&_code] and keeps the dashed border, hover and transition on [&>a>code] since they only make sense on the link. h1 and h4 never sized code, so they are left as is.

📝 Checklist

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

@vercel

vercel Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated
ui Ready Ready Preview Oct 26, 2026 9:36am UTC
ui-repl Ready Ready Preview Oct 26, 2026 9:36am UTC

Request Review

@coderabbitai

coderabbitai Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c5ed4a18-ff67-46f6-b71e-30ad9577272e
Commits

Reviewing files that changed from the base of the PR and between cb5271a and 40f7c22.

Files selected for processing: 2
  • src/theme/prose/h2.ts
  • src/theme/prose/h3.ts

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

Walkthrough

The H2 and H3 base classes now apply code font size and weight to all nested code elements, not only code inside links. The H2 link-specific border and hover styles remain unchanged.

Priority: Low

Estimated code review effort: 1 (Trivial) | ~4 minutes

Merge Risk: Minimal · up to 40f7c

The targeted heading-style fix is consistent with the stated behavior and is ready to merge.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title clearly and concisely identifies the bug fix for inline code sizing in headings without anchor links.
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2…
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.
Description check Passed The pull request description clearly describes the h2 and h3 inline code sizing bug and the selector changes that fix it.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2 files.

Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@pkg-pr-new

pkg-pr-new Bot commented Oct 26, 2026

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

commit: 40f7c22

@codspeed

codspeed Bot commented Oct 26, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 31 untouched benchmarks
⏩ 10 skipped benchmarks1


Comparing fix/prose-heading-code-size (40f7c22) with v4 (cb5271a)

Open in CodSpeed

Footnotes

  1. 10 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

@benjamincanac
benjamincanac merged commit ce2cee0 into v4 Oct 26, 2026
37 checks passed
@benjamincanac
benjamincanac deleted the fix/prose-heading-code-size branch October 26, 2026 09:40

This branch was successfully deployed

2 active deployments
Preview – ui — 40f7c221 Deployed Oct 26, 2026 by vercel[bot]
Preview – ui-repl — 40f7c221 Deployed Oct 26, 2026 by vercel[bot]
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