diff --git a/crates/gpui_macros/src/styles.rs b/crates/gpui_macros/src/styles.rs index 4e3dda9ed2491a6fdbe2bc6ae4d4481532c4acc5..0038bf49d882c8884b92f9084ec235648a8982eb 100644 --- a/crates/gpui_macros/src/styles.rs +++ b/crates/gpui_macros/src/styles.rs @@ -405,6 +405,23 @@ pub fn box_shadow_style_methods(input: TokenStream) -> TokenStream { self } + /// Sets the box shadow of the element. + /// + /// A hairline shadow is a very thin shadow that is often used + /// to create a subtle depth effect under an element. + #visibility fn shadow_hairline(mut self) -> Self { + use gpui::{BoxShadow, hsla, point, px}; + use std::vec; + + self.style().box_shadow = Some(vec![BoxShadow { + color: hsla(0.0, 0.0, 0.0, 0.16), + offset: point(px(0.), px(1.)), + blur_radius: px(0.), + spread_radius: px(0.), + }]); + self + } + /// Sets the box shadow of the element. /// [Docs](https://tailwindcss.com/docs/box-shadow) #visibility fn shadow_sm(mut self) -> Self { diff --git a/crates/ui/src/components/button/split_button.rs b/crates/ui/src/components/button/split_button.rs index c0811ecbab9f3897328edd25c8fdd6bd85ffabbc..372da9f2044a10e782ee3558621bc5a280bbf026 100644 --- a/crates/ui/src/components/button/split_button.rs +++ b/crates/ui/src/components/button/split_button.rs @@ -41,11 +41,6 @@ impl RenderOnce for SplitButton { ) .child(self.right) .bg(ElevationIndex::Surface.on_elevation_bg(cx)) - .shadow(vec![BoxShadow { - color: hsla(0.0, 0.0, 0.0, 0.16), - offset: point(px(0.), px(1.)), - blur_radius: px(0.), - spread_radius: px(0.), - }]) + .shadow_hairline() } }