Skip to content

Commit bc869e8

Browse files
authored
fix: make single end slot aligned properly, add missing tests (#9156)
1 parent ef8bb03 commit bc869e8

File tree

4 files changed

+33
-1
lines changed

4 files changed

+33
-1
lines changed

packages/horizontal-layout/src/vaadin-horizontal-layout-styles.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export const baseStyles = css`
4040
margin-inline-end: auto;
4141
}
4242
43-
:host([has-start]:not([has-middle])) ::slotted([first-end-child]) {
43+
:host(:not([has-middle])) ::slotted([first-end-child]) {
4444
margin-inline-start: auto;
4545
}
4646
`;

packages/horizontal-layout/test/visual/lumo/horizontal-layout.test.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,5 +151,37 @@ describe('horizontal-layout', () => {
151151
await visualDiff(element, 'slots-without-middle');
152152
});
153153
});
154+
155+
describe('only middle', () => {
156+
beforeEach(() => {
157+
element = fixtureSync(
158+
`
159+
<vaadin-horizontal-layout style="border: solid 1px blue; width: 400px;" theme="spacing wrap">
160+
<div slot="middle" style="background: #ffd700;">Middle</div>
161+
</vaadin-horizontal-layout>
162+
`,
163+
);
164+
});
165+
166+
it('default', async () => {
167+
await visualDiff(element, 'slots-only-middle');
168+
});
169+
});
170+
171+
describe('only end', () => {
172+
beforeEach(() => {
173+
element = fixtureSync(
174+
`
175+
<vaadin-horizontal-layout style="border: solid 1px blue; width: 400px;" theme="spacing wrap">
176+
<div slot="end" style="background: #f08080; width: 100px">End</div>
177+
</vaadin-horizontal-layout>
178+
`,
179+
);
180+
});
181+
182+
it('default', async () => {
183+
await visualDiff(element, 'slots-only-end');
184+
});
185+
});
154186
});
155187
});
554 Bytes
Loading
651 Bytes
Loading

0 commit comments

Comments
 (0)