From 8a33eabb2583202fcc8fbc33e8f2ed23bb45f1a4 Mon Sep 17 00:00:00 2001 From: Shrinidhi Upadhyaya Date: Tue, 15 Oct 2024 09:16:05 +0200 Subject: [PATCH] fix(theme): show margin only with label in Switch component (#3861) * fix(switch): removed right margin in wrapper #3791 * feat(changeset): added changeset * fix(switch): removed me-2 in wrapper * fix(switch): added ms-2 to label * chore(changeset): correct package and message --------- Co-authored-by: WK Wong --- .changeset/tricky-fans-draw.md | 5 +++++ packages/core/theme/src/components/toggle.ts | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 .changeset/tricky-fans-draw.md diff --git a/.changeset/tricky-fans-draw.md b/.changeset/tricky-fans-draw.md new file mode 100644 index 0000000000..b0e1a5d121 --- /dev/null +++ b/.changeset/tricky-fans-draw.md @@ -0,0 +1,5 @@ +--- +"@nextui-org/theme": patch +--- + +show margin only with label in Switch component (#3791) diff --git a/packages/core/theme/src/components/toggle.ts b/packages/core/theme/src/components/toggle.ts index f8d32f7032..a06217e8ae 100644 --- a/packages/core/theme/src/components/toggle.ts +++ b/packages/core/theme/src/components/toggle.ts @@ -57,7 +57,7 @@ const toggle = tv({ startContent: "z-0 absolute start-1.5 text-current", endContent: "z-0 absolute end-1.5 text-default-600", thumbIcon: "text-black", - label: "relative text-foreground select-none", + label: "relative text-foreground select-none ms-2", }, variants: { color: { @@ -100,7 +100,7 @@ const toggle = tv({ }, size: { sm: { - wrapper: "w-10 h-6 me-2", + wrapper: "w-10 h-6", thumb: [ "w-4 h-4 text-tiny", //selected @@ -111,7 +111,7 @@ const toggle = tv({ label: "text-small", }, md: { - wrapper: "w-12 h-7 me-2", + wrapper: "w-12 h-7", thumb: [ "w-5 h-5 text-small", //selected @@ -122,7 +122,7 @@ const toggle = tv({ label: "text-medium", }, lg: { - wrapper: "w-14 h-8 me-2", + wrapper: "w-14 h-8", thumb: [ "w-6 h-6 text-medium", //selected