From a4df5a0d97a752cba0768438486a15d1bc5ac640 Mon Sep 17 00:00:00 2001 From: Carl Mensah Date: Fri, 13 Sep 2024 13:11:14 +0100 Subject: [PATCH] feat: handle prefix/affix btn group select padding scaling issue --- components/control/Input/Input.css | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/components/control/Input/Input.css b/components/control/Input/Input.css index e998112..6e9e342 100644 --- a/components/control/Input/Input.css +++ b/components/control/Input/Input.css @@ -67,10 +67,10 @@ diamond-input { select { cursor: pointer; margin-right: calc( - var(--diamond-icon-size) * -1 - var(--diamond-input-padding-inline) * 0.5 + var(--diamond-icon-size) * -1 - var(--diamond-input-padding-inline) ); padding-right: calc( - var(--diamond-icon-size) + var(--diamond-input-padding-inline) * 1.5 + var(--diamond-icon-size) + var(--diamond-input-padding-inline) ); } @@ -84,15 +84,21 @@ diamond-input { box-sizing: content-box; flex-shrink: 0; inline-size: var(--diamond-icon-size); + pointer-events: none; } /* Prefix */ &:has(* + :is(input, textarea, select)) > :first-child { + margin-right: calc(var(--diamond-input-padding-inline) / 2 * -1); padding: 0 0 0 calc(var(--diamond-input-padding-inline) / 2); } /* Suffix */ :is(input, textarea, select) + * { - padding: 0 calc(var(--diamond-input-padding-inline) / 2) 0 0; + padding: 0 calc(var(--diamond-input-padding-inline) / 2); + } + + :is(input, textarea):has(+ *) { + padding-right: 0; } }