SIGN IN SIGN UP

button: Give Button a neutral default line height (#2822)

`Button` inherits its line height from the surrounding text style, which
makes the text box taller than the glyphs it contains. The caller's
padding then no longer determines the control height, so a button cannot
be sized precisely — a `h(28).py(6)` button ends up taller than 28px,
and vertical centering drifts with the ambient font.

Setting `line_height(relative(1.))` makes the text box exactly the font
size, so padding is the only thing deciding the height.

This is geometry rather than visual policy, which is why it belongs in
Base: it does not pick a look, it removes an ambient value that stops
the presentation layer from controlling its own sizing. It is applied
before `refine_style`, so anything the caller sets still wins.

```rust
Button::new("save").line_height(relative(1.4)) // still yours
```

**Note for review:** this changes the rendered height of every existing
unstyled Button whose caller relied on the inherited line height,
including `gpui-component`'s styled buttons. `cargo test -p gpui-base`
(568 tests) passes, but the story gallery is worth a look before
merging.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
J
Jason Lee committed
ad097c4346422c53c6ac08fc07578a1596030922
Parent: c27f5d5
Committed by GitHub <noreply@github.com> on 8/24/2026, 3:06:47 PM