Skip to content

Commit 1587008

Browse files
authored
refactor: update popover overlay Lumo CSS to use base styles (#10064)
1 parent 67dab03 commit 1587008

File tree

76 files changed

+49
-167
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+49
-167
lines changed

packages/popover/src/styles/vaadin-popover-overlay-base-styles.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ const popoverOverlay = css`
8585
}
8686
8787
:host([theme~='arrow']) {
88-
--_default-offset: calc(4px + var(--_arrow-size) / 2);
88+
--_default-offset: var(--_arrow-size);
8989
}
9090
9191
:host([theme~='arrow']) [part='arrow'] {

packages/popover/src/vaadin-popover-overlay.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ class PopoverOverlay extends PopoverOverlayMixin(
3434
return popoverOverlayStyles;
3535
}
3636

37+
static get lumoInjector() {
38+
return {
39+
includeBaseStyles: true,
40+
};
41+
}
42+
3743
/** @protected */
3844
render() {
3945
return html`

packages/popover/test/visual/lumo/popover.test.js

Lines changed: 40 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -24,35 +24,47 @@ describe('popover', () => {
2424
await nextRender();
2525
});
2626

27-
[
28-
'top-start',
29-
'top',
30-
'top-end',
31-
'bottom-start',
32-
'bottom',
33-
'bottom-end',
34-
'start-top',
35-
'start',
36-
'start-bottom',
37-
'end-top',
38-
'end',
39-
'end-bottom',
40-
].forEach((position) => {
41-
it(position, async () => {
42-
element.position = position;
43-
await nextUpdate(element);
44-
target.click();
45-
await nextRender();
46-
await visualDiff(div, position);
47-
});
27+
['ltr', 'rtl'].forEach((dir) => {
28+
describe(dir, () => {
29+
before(() => {
30+
document.documentElement.setAttribute('dir', dir);
31+
});
4832

49-
it(`${position} arrow`, async () => {
50-
element.setAttribute('theme', 'arrow');
51-
element.position = position;
52-
await nextUpdate(element);
53-
target.click();
54-
await nextRender();
55-
await visualDiff(div, `${position}-arrow`);
33+
after(() => {
34+
document.documentElement.removeAttribute('dir');
35+
});
36+
37+
[
38+
'top-start',
39+
'top',
40+
'top-end',
41+
'bottom-start',
42+
'bottom',
43+
'bottom-end',
44+
'start-top',
45+
'start',
46+
'start-bottom',
47+
'end-top',
48+
'end',
49+
'end-bottom',
50+
].forEach((position) => {
51+
it(position, async () => {
52+
element.position = position;
53+
await nextUpdate(element);
54+
target.click();
55+
await nextRender();
56+
await visualDiff(div, `${dir}-${position}`);
57+
});
58+
59+
it(`${position} arrow`, async () => {
60+
element.setAttribute('theme', 'arrow');
61+
element.position = position;
62+
await nextUpdate(element);
63+
target.click();
64+
await nextRender();
65+
await visualDiff(div, `${dir}-${position}-arrow`);
66+
});
67+
});
5668
});
5769
});
5870

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)