refactor(close): use wordmark-light.svg for brand mark - #47
Conversation
Replace the hand-composed "decdn_" spans with the canonical public/wordmark-light.svg, matching the navbar pattern. Sized via a dedicated fluid clamp so the mark stays substantial on phones, with a height-relative negative margin-left to push it past the content edge. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Deploying website with
|
| Latest commit: |
93898d1
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://e22e513c.website-70y.pages.dev |
| Branch Preview URL: | https://close-wordmark-svg.website-70y.pages.dev |
There was a problem hiding this comment.
Pull request overview
Refactors the Contact (“Close”) section’s brand mark to use the exported public/wordmark-light.svg (matching the existing <img> approach used elsewhere in the site under output: "export" constraints), and adjusts responsive sizing/positioning to improve appearance across viewports.
Changes:
- Replaced the styled
decdn_text markup with an<img>pointing at/wordmark-light.svg. - Added a dedicated responsive height curve via
clamp(...)and used it to derive a proportional negativemargin-left. - Preserved the existing scroll reveal behavior by keeping
data-revealon the new element.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Code Review
This pull request replaces the text-based logo in the Close component with an SVG image. The review feedback suggests improving accessibility by removing the decorative underscore from the image's alt text to match the previous implementation's screen reader behavior. Additionally, it recommends simplifying the TypeScript casting for inline CSS variables by casting the entire style object to React.CSSProperties instead of individual keys.
| ["--wordmark-h" as string]: "clamp(4.75rem, 14vw, 11.5rem)", | ||
| height: "var(--wordmark-h)", | ||
| width: "auto", | ||
| marginLeft: "calc(var(--wordmark-h) * -0.18)", | ||
| }} |
There was a problem hiding this comment.
Casting individual CSS variable keys with as string is a bit verbose. A cleaner approach in TypeScript is to cast the entire style object to React.CSSProperties, which allows for arbitrary property names starting with -- without needing individual casts for each key.
| ["--wordmark-h" as string]: "clamp(4.75rem, 14vw, 11.5rem)", | |
| height: "var(--wordmark-h)", | |
| width: "auto", | |
| marginLeft: "calc(var(--wordmark-h) * -0.18)", | |
| }} | |
| "--wordmark-h": "clamp(4.75rem, 14vw, 11.5rem)", | |
| height: "var(--wordmark-h)", | |
| width: "auto", | |
| marginLeft: "calc(var(--wordmark-h) * -0.18)", | |
| } as React.CSSProperties} |
There was a problem hiding this comment.
Thanks — valid as a project-wide convention question, but not the right scope for this PR. The per-key ["--var" as string] cast is used 9× across 6 files today and there are zero as React.CSSProperties casts; switching this single site would create the codebase's first outlier (and the immediate neighbors in Close.tsx lines 39 and 49 still use the per-key form). Tracked for a sweep evaluation in #48.
Screen readers were announcing the trailing "_" literally
("decdn underscore"). The previous text-based markup hid it via
aria-hidden; replicate that intent for the <img> by removing it from
the alt. Applied to Close and to both Chrome navbar variants for
consistency.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Without width/height attrs the browser falls back to the 300x150 replaced-element default until the SVG resource is fetched, then re-flows to the real 411:110 ratio — a horizontal layout shift in the surrounding flex column. The HTML attrs only feed the browser's aspect-ratio reservation; CSS continues to control rendered size via var(--wordmark-h). Mirrors the existing Chrome.tsx wordmark pattern. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Summary
public/wordmark-light.svg, mirroring the existingChrome.tsx<img>pattern (output: "export"rules outnext/image).clamp(4.75rem, 14vw, 11.5rem)) so phones don't fall to the--fs-displayfloor.margin-leftso the mark visually outdents past the content's left edge across viewports._fromalttext on the wordmark<img>in bothClose.tsxandChrome.tsx(light/dark variants). The original text-based markup hid the underscore viaaria-hidden; the new image now mirrors that behavior so screen readers announce "decdn" instead of "decdn underscore".Test plan
pnpm lintcleanpnpm build(static export) succeeds/#contactrenders the wordmark at ~360px, ~768px, ~1440px without overflowReviewer feedback
bb1bb59).styleobject asReact.CSSPropertiesinstead of the per-key["--var" as string]cast. The new code matches the existing["--reveal-delay" as string]pattern atClose.tsx:36; switching styles in one spot would diverge from neighboring code without functional benefit.🤖 Generated with Claude Code