Lint: tight-leading display type overlapping its neighbor (rule 36) - #51
Merged
Conversation
An oversized display heading/wordmark with line-height < ~1 (leading-none, leading-[0.8], line-height: .85, etc.) reserves less vertical space than its glyph ink occupies — descenders and ascenders spill outside the line box and overlap the next block when no clearance is reserved. This is distinct from horizontal overflow (rule 24) and all-caps cap-collision-on-wrap (rule 25). Adds rule 36 to checks/builtin-lint.md with grep detection for tight-leading classes/CSS (tested clean against templates/scaffold-base/, which uses leading-tight/leading-relaxed and only line-height: 1 on chips/buttons — no false positives), an honest note that confirming actual glyph overlap needs a screenshot/DOM read, and a fix (padding-bottom/margin-bottom clearance or raising line-height toward 1). Bumps the report template's rule count 35 -> 36. Adds a matching one-line build note in reference/build.md near the spacing/ squint-test guidance in Step 6. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug class
An oversized display heading / wordmark set with a tight
line-height(< ~1) —leading-none,leading-[0.8],line-height: .85, etc. — reserves less vertical space than its glyph ink actually occupies. Descenders (p, y, g, q, j, comma, period) overflow below the line box, and ascenders overflow above it, so the vertically-adjacent block (next paragraph/section) overlaps the glyphs when no clearance is reserved. Observed on a real generated page.This is distinct from:
Tight leading is not the bug by itself — tight leading with a flush neighbor and no reserved clearance is.
Changes
checks/builtin-lint.md## Vertical rhythmsection, following the existing rule format (rationale, honest part-heuristic detection like rules 29/33/35, grep, fix).line-heightvalues (CSS), with an explicit caveat that confirming the actual glyph/box overlap needs a screenshot or DOM read (claude-in-chrome), not grep alone.**Rules checked:**from 35 to 36 (the only place that count appears in the repo — grepped to confirm).reference/build.mdTesting
Ran both new greps against
templates/scaffold-base/:leading-none/leading-[0.x]class grep → no matches (scaffold's hero<h1>usesleading-tight, not tight-none).line-height: 0.xCSS grep → no matches (scaffold's twoline-height: 1;declarations are on.chipand.proto-seg, not display headings, and1isn't< 1).Also verified both greps fire correctly against a synthetic tight-leading display-heading test case, so the patterns aren't dead weight.
Docs-only change —
SKILL.mduntouched per instructions (no token headroom).🤖 Generated with Claude Code