Skip to content

Commit 5ead07a

Browse files
committed
Merge remote-tracking branch 'origin/main' into fix/2075-panel-tooltip-in-buttons-in-action-slot-triggers-overflow-menu
2 parents 9600e28 + 09a1533 commit 5ead07a

File tree

3 files changed

+27
-2
lines changed

3 files changed

+27
-2
lines changed

.changeset/eager-bikes-look.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@sl-design-system/form': patch
3+
---
4+
5+
Fixed alignment of warning icon when an error spans over more than 2 lines.
Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,25 @@
11
:host {
2-
align-items: center;
2+
align-items: start;
33
color: var(--sl-color-foreground-negative-plain);
44
display: flex;
55
font-weight: var(--sl-text-new-typeset-fontWeight-semiBold);
66
gap: var(--sl-size-050);
77
padding-block-start: var(--sl-size-050);
88
}
9+
10+
slot {
11+
display: inline-block;
12+
}
13+
14+
sl-icon {
15+
// Vertically center the icon with the text when the error message is a multi line and we can't center it with flexbox.
16+
// The icon needs to be centered in the line-height of the text (1lh) and the size of the icon calculated with max() (same as in the icon component).
17+
margin-block-start: calc((1lh - max(0.8em, var(--sl-icon-size))) / 2);
18+
}
19+
20+
// There are some really old browsers that don't support `cap` yet, so we use a fallback with `em`.
21+
@supports (inline-size: 1cap) {
22+
sl-icon {
23+
margin-block-start: calc((1lh - max(1cap, var(--sl-icon-size))) / 2);
24+
}
25+
}

packages/components/form/src/form-field.stories.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,10 @@ export const CustomError: Story = {
184184
args: {
185185
slot: () => html`
186186
<sl-text-field required show-validity="invalid"></sl-text-field>
187-
<sl-error>This is a <strong>custom</strong> error</sl-error>
187+
<sl-error
188+
>This is a <strong>custom</strong> error with a lot of text so we can see what happens when you have a lot to
189+
explain. Because forms are hard!</sl-error
190+
>
188191
`
189192
}
190193
};

0 commit comments

Comments
 (0)