Skip to content

Commit 2f5b842

Browse files
authored
Fix prepending icons and vertical alignment (#1104)
* fix prepending icons and vertical alignment * fix styling around icons and line height for ref items * fix icon in table by fixing empty label for checkbox
1 parent 9177e1a commit 2f5b842

File tree

7 files changed

+28
-5
lines changed

7 files changed

+28
-5
lines changed

packages/uui-base/lib/mixins/LabelMixin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export const LabelMixin = <T extends Constructor<LitElement>>(
6565
: ''}
6666
<slot
6767
class="label"
68-
style=${this._labelSlotHasContent ? '' : 'visibility: hidden'}
68+
style=${this._labelSlotHasContent ? '' : 'display: none'}
6969
name=${labelSlotName ? labelSlotName : ''}
7070
@slotchange=${this.labelSlotChanged}></slot>
7171
`;

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,10 @@ export abstract class UUIBooleanInputElement extends UUIFormControlMixin(
256256
.label {
257257
display: block;
258258
}
259+
260+
span.label:empty {
261+
display: none;
262+
}
259263
`,
260264
];
261265
}

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>

packages/uui-ref-node/lib/uui-ref-node.element.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,8 @@ export class UUIRefNodeElement extends UUIRefElement {
183183
display: flex;
184184
flex-grow: 1;
185185
align-items: center;
186-
justify-content: center;
187186
line-height: 1.2em;
188-
padding: calc(var(--uui-size-2));
187+
padding: calc(var(--uui-size-3));
189188
}
190189
191190
#open-part {
@@ -211,10 +210,12 @@ export class UUIRefNodeElement extends UUIRefElement {
211210
justify-content: center;
212211
height: 100%;
213212
padding-left: var(--uui-size-2);
213+
margin-top: 1px;
214214
}
215215
216216
#detail {
217217
opacity: 0.6;
218+
line-height: 1.2em;
218219
}
219220
220221
:host([selectable]) #open-part {

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ export class UUIRefElement extends SelectOnlyMixin(
6969
justify-content: space-between;
7070
align-items: center;
7171
width: 100%;
72+
font-size: var(--uui-font-size);
7273
7374
box-sizing: border-box;
7475
border-radius: var(--uui-border-radius);

packages/uui-table/lib/uui-table-advanced-example.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ export class UUITableWithSelectionExampleElement extends LitElement {
199199
@selected=${() => this._selectRowHandler(item)}
200200
@deselected=${() => this._deselectRowHandler(item)}>
201201
<uui-table-cell>
202-
<uui-icon name="wand" style="font-size: 20px;"></uui-icon>
202+
<uui-icon name="wand"></uui-icon>
203203
<uui-checkbox
204204
@click=${(e: MouseEvent) => e.stopPropagation()}
205205
@change=${(event: Event) => this._selectHandler(event, item)}

0 commit comments

Comments
 (0)