# gpui: Make style macros more composable \(\#14007\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 3cdd46522629a051638f32c21c9a5d6c78015081

Requested commit: 3cdd46522629a051638f32c21c9a5d6c78015081

Commit: 3cdd46522629a051638f32c21c9a5d6c78015081

Tree: d8d0ebaa845c50272f1f7abbf3c831f4a96c3436

Author: Marshall Bowers

Committer: GitHub

## Message

````
gpui: Make style macros more composable (#14007)

This PR begins the process of breaking up the `style_helpers!` macro
into smaller macros that can be used to generate methods for a related
subset of styles.

The style method macros also now accept an optional `visibility`
parameter to control the visibility of the generated methods. This
allows for adding these methods to a struct instead of a just a trait.

For example, to expose just the padding styles on a `Facepile` we can do
this:

```rs
impl Facepile {
    fn style(&mut self) -> &mut StyleRefinement {
        self.base.style()
    }

    gpui::padding_style_methods!({
        visibility: pub
    });
}
```

Release Notes:

- N/A
````

## Parents

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

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