From b00d9282ab75a496cd3b7e6fa40754c05f990482 Mon Sep 17 00:00:00 2001 From: Volpeon Date: Tue, 8 Feb 2022 07:29:42 +0100 Subject: Improved radio and switch positioning --- src/objects/_switch.scss | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'src/objects/_switch.scss') diff --git a/src/objects/_switch.scss b/src/objects/_switch.scss index cc215a5..4417297 100644 --- a/src/objects/_switch.scss +++ b/src/objects/_switch.scss @@ -56,7 +56,6 @@ @include iro.bem-elem('indicator') { display: block; - position: relative; box-sizing: border-box; flex: 0 0 auto; width: fn.dim(--width); @@ -69,14 +68,9 @@ &::after { content: ''; display: block; - position: absolute; - z-index: 10; - top: 50%; - left: 0; width: calc(fn.dim(--height) - 2 * fn.dim(--border-width)); height: calc(fn.dim(--height) - 2 * fn.dim(--border-width)); - transform: translateY(-50%); - transition: left .2s ease; + transition: transform .2s ease; border: fn.dim(--border-width) solid fn.color(--handle-border); border-radius: fn.dim(--width); background-color: fn.color(--handle-bg); @@ -116,7 +110,7 @@ background-color: fn.color(--handle-border); &::after { - left: calc(fn.dim(--width) - fn.dim(--height) + .5px); + transform: translate(calc(fn.dim(--width) - fn.dim(--height) + .5px), 0); border-color: fn.color(--handle-border); } } -- cgit v1.2.3-54-g00ecf