From 41ce08c18dede1524627c2395ec5f611711d4907 Mon Sep 17 00:00:00 2001 From: Pouya Saadeghi Date: Wed, 22 Jun 2022 19:03:11 +0300 Subject: [PATCH] feat: add `btn-group-vertical` --- src/components/styled/button.css | 11 +++++------ .../src/routes/components/button-group.svelte.md | 16 ++++++++++++++++ 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/src/components/styled/button.css b/src/components/styled/button.css index a3cffe57d08..faf4bb9c728 100644 --- a/src/components/styled/button.css +++ b/src/components/styled/button.css @@ -215,18 +215,17 @@ outline: 2px solid hsl(var(--p)); } } - & > .btn:not(:first-of-type) { + &:not(.btn-group-vertical) > .btn:not(:first-of-type) { @apply -ml-px rounded-l-none; } - & > .btn:not(:last-of-type) { + &:not(.btn-group-vertical) > .btn:not(:last-of-type) { @apply rounded-r-none; } - &-vertical - { - .btn:not(:first-of-type) { + &-vertical { + & > .btn:not(:first-of-type) { @apply -mt-px rounded-t-none; } - .btn:not(:last-of-type) { + & > .btn:not(:last-of-type) { @apply rounded-b-none; } } diff --git a/src/docs/src/routes/components/button-group.svelte.md b/src/docs/src/routes/components/button-group.svelte.md index 01bc1268f9a..43e55b1887e 100644 --- a/src/docs/src/routes/components/button-group.svelte.md +++ b/src/docs/src/routes/components/button-group.svelte.md @@ -14,6 +14,7 @@ published: true @@ -32,6 +33,21 @@ data="{[ } + +
+ + + +
+
{
+`
+ + + +
` +}
+
+