Skip to content

Commit

Permalink
feat: add no-padding theme variant to popover (#7650)
Browse files Browse the repository at this point in the history
  • Loading branch information
web-padawan authored Aug 13, 2024
1 parent 497e10f commit 1eb6586
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/popover/test/visual/lumo/popover.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,11 @@ describe('popover', () => {
await visualDiff(div, `${position}-arrow`);
});
});

it('no-padding', async () => {
element.setAttribute('theme', 'no-padding');
target.click();
await nextRender();
await visualDiff(div, 'no-padding');
});
});
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions packages/popover/test/visual/material/popover.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,11 @@ describe('popover', () => {
await visualDiff(div, `${position}-arrow`);
});
});

it('no-padding', async () => {
element.setAttribute('theme', 'no-padding');
target.click();
await nextRender();
await visualDiff(div, 'no-padding');
});
});
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions packages/popover/theme/lumo/vaadin-popover-styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ const popoverOverlay = css`
padding: var(--lumo-space-xs) var(--lumo-space-s);
}
:host([theme~='no-padding']) [part='content'] {
padding: 0;
}
:host([theme~='arrow']) {
--_vaadin-popover-default-offset: calc(var(--lumo-space-s) + var(--vaadin-popover-arrow-size) / 2);
}
Expand Down
4 changes: 4 additions & 0 deletions packages/popover/theme/material/vaadin-popover-styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ const popoverOverlay = css`
padding: 0.25rem 0.5rem;
}
:host([theme~='no-padding']) [part='content'] {
padding: 0;
}
:host([theme~='arrow']) {
--_vaadin-popover-default-offset: calc(0.25rem + var(--vaadin-popover-arrow-size) / 1.25);
}
Expand Down

0 comments on commit 1eb6586

Please sign in to comment.