From d1cec209d474866f45e3f7947c5c306347b1be46 Mon Sep 17 00:00:00 2001 From: Danilo Leal <67129314+danilo-leal@users.noreply.github.com> Date: Thu, 6 Mar 2025 15:41:21 -0300 Subject: [PATCH] gpui: Add `rounded_md` token (#26179) This PR adds a new rounded/corner border token: `rounded_md` with a value of 6px. I feel like I was wanting to use 6px border radius a lot but avoiding due to it being an arbitrary value... so, not anymore! It's also cool to have this be consistent with Tailwind v4. Follow on to the prior renames: - `rounded_sm` -> `rounded_xs`: https://github.com/zed-industries/zed/pull/26221 - `rounded_md` -> `rounded_sm`: https://github.com/zed-industries/zed/pull/26228 Release Notes: - N/A --------- Co-authored-by: Marshall Bowers --- crates/assistant2/src/active_thread.rs | 2 +- crates/editor/src/editor.rs | 2 +- crates/gpui_macros/src/styles.rs | 5 +++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/crates/assistant2/src/active_thread.rs b/crates/assistant2/src/active_thread.rs index 40e438cee32b1442c687d67dc0d6c57c9e820e4c..b9f53190a8007929d16c9c64ecf0aff5e6067650 100644 --- a/crates/assistant2/src/active_thread.rs +++ b/crates/assistant2/src/active_thread.rs @@ -674,7 +674,7 @@ impl ActiveThread { .pr_2() .bg(cx.theme().colors().editor_foreground.opacity(0.02)) .when(is_open, |element| element.border_b_1().rounded_t(px(6.))) - .when(!is_open, |element| element.rounded(px(6.))) + .when(!is_open, |element| element.rounded_md()) .border_color(cx.theme().colors().border) .child( h_flex() diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs index 6fd5591df790472fee6f604d94599d91d8782b44..346fc08bf09adbe901990254026e990d60557460 100644 --- a/crates/editor/src/editor.rs +++ b/crates/editor/src/editor.rs @@ -6550,7 +6550,7 @@ impl Editor { .pl_1() .pr(padding_right) .gap_1() - .rounded(px(6.)) + .rounded_md() .border_1() .bg(Self::edit_prediction_line_popover_bg_color(cx)) .border_color(Self::edit_prediction_callout_popover_border_color(cx)) diff --git a/crates/gpui_macros/src/styles.rs b/crates/gpui_macros/src/styles.rs index e7c25063d0601bbc57a04fe014c05857037918b7..39a93b041877c65eda4e529fed89358559163255 100644 --- a/crates/gpui_macros/src/styles.rs +++ b/crates/gpui_macros/src/styles.rs @@ -1242,6 +1242,11 @@ fn corner_suffixes() -> Vec { radius_tokens: quote! { rems(0.25) }, doc_string_suffix: "4px (0.25rem)", }, + CornerStyleSuffix { + suffix: "md", + radius_tokens: quote! { rems(0.375) }, + doc_string_suffix: "6px (0.375rem)", + }, CornerStyleSuffix { suffix: "lg", radius_tokens: quote! { rems(0.5) },