Skip to content

fix(ui): give buttons a hard edge - #27

Open
Sam Gammon (sgammon) wants to merge 1 commit into
mainfrom
fix/harder-button-edges
Open

Sam Gammon (sgammon) wants to merge 1 commit into
mainfrom
fix/harder-button-edges

Conversation

@sgammon

Copy link
Copy Markdown
Member

What

Buttons read as soft, or blurred, at their edges. Magnified, the cause is two things:

  • The gradient and primary rim was the face's own colours deepened 18%. On a dark page that puts it between the face and the page in tone, so it looks like the face fading out, not like a line.
  • --button-shadow was a blurred glow (up to 10px) around the button.

The outline button had the same character: a rim at 25% of the foreground, with shadow-xs under it.

Change

  • --button-border-background and its hover value contrast with both the face and the page: deeper than the face in the light theme (68% and 60%, from 82% and 76%), and lighter than the face in the dark theme (mixed with white).
  • --button-shadow and --button-shadow-hover are one unblurred pixel of shade.
  • outline: rim at 40% of the foreground, no shadow; its hover rim goes from 60% to 70%.

No API change. changelog and ghost are untouched.

Checks

  • packages/tokens: contrast tests pass (357).
  • Rendered in the marketing site in WebKit and Chromium, light and dark, and compared at pixel level before and after.
  • packages/ui tests and lint were not run locally (the checkout had no dependencies installed); CI covers them.

🤖 Generated with Claude Code

The gradient and primary rim sat between the face and the page in tone,
with a blurred glow under it, so the edge read as soft, most of all on a
dark page. The rim now contrasts with both the face and the page: deeper
than the face in the light theme, lighter than it in the dark theme.

--button-shadow is one unblurred pixel of shade in place of the glow.
The outline button's rim goes from 25% to 40% of the foreground and
loses its shadow.

Contrast tests pass (357). The ui package's tests were not run locally;
this checkout has no dependencies installed.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
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