Skip to content

Commit 18f4123

Browse files
committed
fix prepending icons and vertical alignment
1 parent 2dd7bf6 commit 18f4123

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

packages/uui-input/lib/uui-input.element.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,8 @@ export class UUIInputElement extends UUIFormControlMixin(
478478
479479
input {
480480
font-family: inherit;
481-
padding: var(--uui-size-1) var(--uui-size-space-3);
481+
padding: 1px var(--uui-size-space-3) var(--uui-size-1)
482+
var(--uui-size-space-3);
482483
font-size: inherit;
483484
color: inherit;
484485
border-radius: var(--uui-border-radius);
@@ -502,6 +503,13 @@ export class UUIInputElement extends UUIFormControlMixin(
502503
border: none;
503504
}
504505
506+
slot[name='prepend'],
507+
slot[name='append'] {
508+
display: flex;
509+
align-items: center;
510+
line-height: 1;
511+
}
512+
505513
::slotted(uui-input),
506514
::slotted(uui-input-lock) {
507515
height: 100%;

packages/uui-input/lib/uui-input.story.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,15 @@ export const PrependAndAppend: Story = {
138138
};
139139

140140
export const PrependIcon: Story = {
141+
args: {
142+
'prepend slot': html`<uui-icon
143+
name="search"
144+
slot="prepend"
145+
style="padding-left:var(--uui-size-space-2)"></uui-icon>`,
146+
},
147+
};
148+
149+
export const PrependIconInDiv: Story = {
141150
args: {
142151
'prepend slot': html`<div slot="prepend">
143152
<uui-icon name="search"></uui-icon>

0 commit comments

Comments
 (0)