Skip to content

Copy button never covers code; sticky header height for TagBrush - #5

Merged
evangress merged 3 commits into
mainfrom
fix/demo-findings
Nov 14, 2026
Merged

evangress merged 3 commits into
mainfrom
fix/demo-findings

Conversation

@evangress

Copy link
Copy Markdown
Contributor
  • Copy button covered the end of a one-line code block (the install line's defer on the demo). The <pre> now scrolls inside border-inline-end: 5rem solid transparent instead of padding, so its scroll area stops before the button. It looks the same, since the background shows through the border. Tested at 360, 700 and 1000px with TagBrush.css and at 360px with no stylesheet.
  • Sticky header height: a ResizeObserver on body > header[data-layout="sticky"] sets --tag-header-height on <html>. TagBrush.css's scroll padding reads it (kovirlabs/tagbrush, same branch name), so a heading you jump to clears a bar of any height. data-tagaction="off" opts out. Documented in llms.txt and the README.

Size: 12,026 → 12,150 bytes gzipped. Tests: 175 passed locally in Chromium and WebKit (was 169), including dynamic insertion and resizing.

Merge after #4 (the demo page); I'll resolve the CHANGELOG heading conflict once #4 is in.

🤖 Generated with Claude Code

evangress and others added 3 commits November 13, 2026 20:56
On a <pre> whose line is longer than the block (the install line on the
demo page), the absolutely positioned Copy button sat over the end of the
visible text: 5rem of end padding only helps once scrolled to the very
end. Measured on the demo with TagBrush.css 2: text under the button at
360px and 1280px, "defer" hidden.

The <pre> now has a transparent 5rem end border instead of the padding.
The background shows through a border, so the block looks the same, but
the scrollport ends before the button, so text never runs under it. It
also gets overflow-x: auto, so this holds with no stylesheet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
TagBrush.css keeps room above a heading you jump to under its sticky bar
(<header data-layout="sticky">), but CSS can't read the bar's height, so
the room is a fixed 5rem (7.5rem on phones). A bar taller than that, such
as one that wraps to three rows on a phone (142px against 120px at 360px),
still hid the heading. The nav behavior now watches a sticky page header
with a ResizeObserver and sets --tag-header-height on <html> to its
height; TagBrush.css's scroll padding reads it, falling back to the CSS
value without TagAction. data-tagaction="off" on the header opts out.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@evangress
evangress merged commit ec82277 into main Nov 14, 2026
1 check passed
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