# gpui: Add builder API for BoxShadow \(\#57743\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/34cd17ff5e29b8eef9c48c69c2c56d24a770addc)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 34cd17ff5e29b8eef9c48c69c2c56d24a770addc

Requested commit: 34cd17ff5e29b8eef9c48c69c2c56d24a770addc

Commit: 34cd17ff5e29b8eef9c48c69c2c56d24a770addc

Tree: 70ec16ffe018ac81aabf6b26c0e654941e952f4a

Author: Agus Zubiaga

Committer: GitHub

## Message

```
gpui: Add builder API for BoxShadow (#57743)

Replaces the verbose struct-literal construction of `gpui::BoxShadow`
with a builder API:

- `BoxShadow::new(offset_x, offset_y, color)` takes the required fields,
with arguments ordered to match the CSS `box-shadow` property.
- `.blur_radius(_)`, `.spread_radius(_)`, and `.inset()` set the
optional fields.

All in-tree call sites are migrated, including the Tailwind-style
`shadow_xs`..`shadow_2xl` helpers in `gpui_macros`, the `ElevationIndex`
shadows in `ui`, and various widgets across `editor`, `workspace`,
`agent_ui`, and `ai_onboarding`. The fields on `BoxShadow` remain
public, so external code using struct-literal construction continues to
work.

Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [ ] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- N/A
```

## Parents

- [8cf8528e8ae52d534eafc2669781a03e99572047](https://git.cafe/gitcafe/zed/commit/8cf8528e8ae52d534eafc2669781a03e99572047?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/34cd17ff5e29b8eef9c48c69c2c56d24a770addc?format=markdown)
