Skip to content

Commit fb25bb4

Browse files
feat: add no padding theme
vaadin/vaadin-dialog#231 Co-authored-by: Yuriy Yevstihnyeyev <yuriy@vaadin.com>
1 parent cff5e38 commit fb25bb4

File tree

6 files changed

+47
-0
lines changed

6 files changed

+47
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<!DOCTYPE html>
2+
3+
<head lang="en">
4+
<meta charset="UTF-8" />
5+
<title>Dialog tests</title>
6+
<script>
7+
window.polymerSkipLoadingFontRoboto = true;
8+
</script>
9+
</head>
10+
11+
<body style="height: 600px">
12+
<vaadin-dialog theme="no-padding" opened>
13+
<template>
14+
<div>A very simple dialog with no padding</div>
15+
<button>OK</button>
16+
</template>
17+
</vaadin-dialog>
18+
19+
<script type="module">
20+
(async () => {
21+
const theme = window.location.search.replace(/.*theme=(\w+).*/, '$1') || 'lumo';
22+
23+
await import('../../theme/' + theme + '/vaadin-dialog.js');
24+
25+
window.requestAnimationFrame(() => {
26+
document.body.dataset.ready = true;
27+
});
28+
})();
29+
</script>
30+
</body>
18.8 KB
Loading
12.7 KB
Loading

packages/vaadin-dialog/test/visual/test.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,12 @@ describe('vaadin-dialog', () => {
88
.waitForVisible(locator, 15000)
99
.assertView(`${theme}-default`, locator);
1010
});
11+
12+
it(`${theme}-no-padding`, function () {
13+
return this.browser
14+
.url(`no-padding.html?theme=${theme}`)
15+
.waitForVisible(locator, 15000)
16+
.assertView(`${theme}-no-padding`, locator);
17+
});
1118
});
1219
});

packages/vaadin-dialog/theme/lumo/vaadin-dialog-styles.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ registerStyles(
2828
padding: var(--lumo-space-l);
2929
}
3030
31+
/* No padding */
32+
:host([theme~='no-padding']) [part='content'] {
33+
padding: 0;
34+
}
35+
3136
/* Animations */
3237
3338
:host([opening]),

packages/vaadin-dialog/theme/material/vaadin-dialog-styles.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ registerStyles(
1616
[part='content'] {
1717
padding: 24px;
1818
}
19+
20+
/* No padding */
21+
:host([theme~='no-padding']) [part='content'] {
22+
padding: 0;
23+
}
1924
`,
2025
{ include: ['material-overlay'], moduleId: 'material-dialog' }
2126
);

0 commit comments

Comments
 (0)