Repository navigation
feat: craft pass — focus, contrast, press feedback, reduced motion - #27
Merged
Merged
Conversation
Seven findings from the site audit, none of which were costing a lead today but all of which read as carelessness to anyone who notices them. Focus. Nothing defined a focus style, so Tailwind's preflight left keyboard users with no visible focus anywhere — outline-style computed to `none` on all 38 tabbable elements. A single :focus-visible rule now covers the site. The ring colour is a CSS variable because a green ring on the brand-900 security band would have been the same bug wearing a different hat; .on-dark flips it to a light tone. Contrast. Body copy ran at text-brand-800/60 (3.3:1) and /50 (2.6:1) against a 4.5:1 requirement. Rather than guess, the threshold was computed against every surface the text actually sits on: /75 is the first value that clears 4.5 on cream, white, cream-50 and cream-100 (worst case 4.65). Dark sections move to cream/70. 33 replacements. The +18% spike badge needed its own fix — amber-600 on amber-50 is 3.07:1, amber-800 is 6.84:1. Measured after: 182 text elements checked, 0 failures. Was 21. Press feedback. No button had an :active state, so a tap on a phone gave no acknowledgement at all until the next paint. A .press utility now scales to 0.97 on pointer-down, and degrades to an opacity shift under reduced motion. Reduced motion. 35 elements travelled 24px on scroll and scroll-behavior was globally smooth, with no escape hatch. The reveal now cross-fades without travelling — gentler, not absent. Also handles prefers-reduced-transparency. Mobile menu. Added a dimming scrim, background scroll lock, Escape to close, and aria-expanded/controls. It is kept mounted and toggled by class so it animates closed as well as open; it used to vanish instantly. Mobile product demo. The invoice card was `hidden lg:block`, so phone visitors never saw the product — the most persuasive element on the page was desktop only. Verified no horizontal overflow at 375px. Loading spinner. Was orange on slate, left over from an older theme. The first thing any visitor saw was the wrong brand. Co-Authored-By: Claude Opus 5 <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
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.
The last seven findings from the site audit. None were costing a lead today; all of them read as carelessness to anyone who notices.
Keyboard focus was invisible
Nothing in the site defined a focus style, so Tailwind's preflight reset left
outline-style: noneon all 38 tabbable elements. A keyboard user had no idea where they were.One
:focus-visiblerule now covers the site. The ring colour is a CSS variable, because a green ring on the brand-900 security band would have been the same bug in a different costume —.on-darkflips it to a light tone.Verified with a real Tab press, not programmatic
.focus()(which does not trigger:focus-visibleand gave a false negative first time round).Contrast: 21 failures → 0
Body copy ran at
text-brand-800/60— 3.3:1 against a 4.5:1 requirement — and/50at 2.6:1.Rather than pick a value that looked better, I computed the threshold against every surface the text actually sits on:
75% is the first value clearing 4.5 everywhere. Dark sections move to
cream/70(6.34:1 on brand-900, 5.51:1 on brand-800). 33 replacements.The
+18%spike badge needed its own fix:amber-600onamber-50is 3.07:1;amber-800is 6.84:1.Measured after: 182 text elements checked, 0 failures.
Press feedback
No button had an
:activestate. On a phone, tapping "Start Free Trial" gave no acknowledgement until the next page painted. A.pressutility now scales to 0.97 on pointer-down across 11 buttons, degrading to an opacity shift under reduced motion.Reduced motion
35 elements travelled 24px on scroll, and
scroll-behaviorwas globally smooth, with no escape hatch for a motion-sensitive visitor. The reveal now cross-fades without travelling — gentler, not absent. Also handlesprefers-reduced-transparency.Mobile menu
Added a dimming scrim, background scroll lock, Escape-to-close, and
aria-expanded/aria-controls. Kept mounted and toggled by class so it animates closed as well as open — previously it slid open and then vanished.The product is now visible on phones
The invoice demo card was
hidden lg:block. Phone visitors never saw the product at all. Verified: no horizontal overflow at 375px (card sits 20–355px in a 375px viewport).Loading spinner
Orange on slate grey, left over from an older theme — the first thing every visitor saw was the wrong brand. Now green on cream.
🤖 Generated with Claude Code