Skip to content

Commit

Permalink
feat: handle prefix/affix btn group select padding scaling issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Carl-J-M committed Sep 13, 2024
1 parent 985e21a commit a4df5a0
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions components/control/Input/Input.css
Original file line number Diff line number Diff line change
Expand Up @@ -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)
);
}

Expand All @@ -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;
}
}

0 comments on commit a4df5a0

Please sign in to comment.