Skip to content

Fix inline code rendering as empty boxes over page covers (RND-12266) - #4484

Draft
zenoachtig wants to merge 1 commit into
mainfrom
claude/tender-allen-nxkig6-rnd-12266
Draft

Fix inline code rendering as empty boxes over page covers (RND-12266)#4484
zenoachtig wants to merge 1 commit into
mainfrom
claude/tender-allen-nxkig6-rnd-12266

Conversation

@zenoachtig

Copy link
Copy Markdown
Contributor

Proposed changes

Inline code (and keyboard kbd) chips render as empty boxes on published pages that use a background cover (e.g. a home page). RND-12266 reports this affects all inline code (order_id, amount, Content-Type, …), only after publishing, and persists in incognito.

Root cause. Cover-aware contrast text (introduced/reworked in #4477) marks page-body paragraphs and headings that overlap a background cover. An element that crosses the cover's bottom edge gets data-over-cover="split", and the text-contrast-cover utility then paints it with color: transparent + -webkit-text-fill-color: transparent and a background-image gradient clipped to the text via background-clip: text.

That works for the paragraph's own text runs, but an inline <code>/<kbd> is a nested element:

  • it inherits the transparent color / -webkit-text-fill-color, so its glyphs are painted transparent;
  • background-image and background-clip are not inherited, so it never gets a text-clipped gradient of its own to paint the glyphs back.

Because the chip also paints its own bg-tint background and ring, the result is a visible box with invisible text — an empty box. (The RecordCard fix in the same PR handled the analogous "paints its own background" case by opting out of cover-aware text; inline chips inside a legitimately cover-aware paragraph can't opt the whole paragraph out, so they need to reset their own fill.)

Fix. Inside the split rule of text-contrast-cover, restore a solid, readable fill for code/kbd descendants using --cover-text-below (the normal below-cover text color, theme-aware). These chips paint their own background, so the cover is never behind their glyphs and they don't need the gradient. Scoped to the split case only; the flat full-cover case was already fine.

Changelog

  • [Fix] Fix inline code rendering as empty boxes on published pages with a background cover.

🌙 Night-shift draft — root-caused but NOT verified in a running browser. Please sanity-check before marking ready.


Generated by Claude Code

On pages with a background cover, paragraphs/headings that cross the cover's
bottom edge get the `text-contrast-cover` "split" treatment: transparent text
fill plus a text-clipped gradient. Inline `code`/`kbd` chips paint their own
background, so the cover is never behind their glyphs, yet they inherit the
transparent fill without receiving a gradient of their own — leaving them as
empty boxes on the published site. Restore a solid, readable fill for these
chips inside split cover-aware text.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XGcATnYSXJ5aMDHjnZX1Pe
@linear-code

linear-code Bot commented Aug 11, 2026

Copy link
Copy Markdown

RND-12266

@changeset-bot

changeset-bot Bot commented Aug 11, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 3b442cf

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

This PR includes changesets to release 1 package
Name Type
gitbook 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

@argos-ci

argos-ci Bot commented Aug 11, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
customers-v2-cloudflare (Inspect) ⚠️ Changes detected (Review) 40 changed, 3 ignored Aug 11, 2026, 12:38 AM
customers-v2-vercel (Inspect) ⚠️ Changes detected (Review) 29 changed, 2 ignored Aug 11, 2026, 12:34 AM
v2-cloudflare (Inspect) ⚠️ Changes detected (Review) 1 changed, 1 ignored Aug 11, 2026, 12:39 AM
v2-vercel (Inspect) ⚠️ Changes detected (Review) 1 changed, 1 ignored Aug 11, 2026, 12:36 AM

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant