From f6636f1318e33c48ef1ec6d15c5485bdae87d5cf Mon Sep 17 00:00:00 2001 From: Vitaly Rtishchev Date: Mon, 12 Dec 2022 14:25:40 +0400 Subject: [PATCH] [@mantine/core] Switch: Fix incorrect alignment (#3082) --- src/mantine-core/src/Switch/Switch.story.tsx | 4 ++++ src/mantine-core/src/Switch/Switch.styles.ts | 7 ++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/mantine-core/src/Switch/Switch.story.tsx b/src/mantine-core/src/Switch/Switch.story.tsx index 99043288ba7..5f2e539ee3e 100644 --- a/src/mantine-core/src/Switch/Switch.story.tsx +++ b/src/mantine-core/src/Switch/Switch.story.tsx @@ -104,3 +104,7 @@ export function WithError() { ); } + +export function Alignment() { + return ; +} diff --git a/src/mantine-core/src/Switch/Switch.styles.ts b/src/mantine-core/src/Switch/Switch.styles.ts index 152568d1fc6..51936d324dd 100644 --- a/src/mantine-core/src/Switch/Switch.styles.ts +++ b/src/mantine-core/src/Switch/Switch.styles.ts @@ -60,13 +60,14 @@ export default createStyles( return { input: { clip: 'rect(1px, 1px, 1px, 1px)', - height: '1px', + height: 0, + width: 0, overflow: 'hidden', - width: '1px', whiteSpace: 'nowrap', - padding: '0', + padding: 0, WebkitClipPath: 'inset(50%)', clipPath: 'inset(50%)', + position: 'absolute', }, track: {