Skip to content

Commit bbc612e

Browse files
authored
feat: add overflow-indicator-top and oveflow-indicator-bottom variants (#10182)
1 parent 23029e1 commit bbc612e

File tree

14 files changed

+34
-19
lines changed

14 files changed

+34
-19
lines changed

dev/scroller.html

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,21 @@ <h2 class="heading">Standard variant</h2>
3131
<div class="content"></div>
3232
</vaadin-scroller>
3333

34-
<h2 class="heading">Overflow indicators variant</h2>
34+
<h2 class="heading">Overflow Indicator Variants</h2>
35+
36+
<h3 class="heading">Top &amp; Bottom</h3>
3537
<vaadin-scroller theme="overflow-indicators">
3638
<div class="content"></div>
3739
</vaadin-scroller>
40+
41+
<h3 class="heading">Top Only</h3>
42+
<vaadin-scroller theme="overflow-indicator-top">
43+
<div class="content"></div>
44+
</vaadin-scroller>
45+
46+
<h3 class="heading">Bottom Only</h3>
47+
<vaadin-scroller theme="overflow-indicator-bottom">
48+
<div class="content"></div>
49+
</vaadin-scroller>
3850
</body>
3951
</html>

packages/scroller/src/styles/vaadin-scroller-base-styles.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ export const scrollerStyles = css`
3333
overflow: hidden;
3434
}
3535
36-
:host([theme~='overflow-indicators'])::before,
37-
:host([theme~='overflow-indicators'])::after {
36+
:host([theme*='overflow-indicator'])::before,
37+
:host([theme*='overflow-indicator'])::after {
3838
content: '';
3939
display: none;
4040
position: sticky;
@@ -45,13 +45,15 @@ export const scrollerStyles = css`
4545
background: var(--vaadin-scroller-border-color, var(--vaadin-border-color-subtle));
4646
}
4747
48-
:host([theme~='overflow-indicators'])::after {
48+
:host([theme*='overflow-indicator'])::after {
4949
margin-bottom: 0;
5050
margin-top: -1px;
5151
}
5252
53+
:host([theme~='overflow-indicator-top'][overflow~='top'])::before,
5354
:host([theme~='overflow-indicators'][overflow~='top'])::before,
54-
:host([theme~='overflow-indicators'][overflow~='bottom'])::after {
55+
:host([theme~='overflow-indicators'][overflow~='bottom'])::after,
56+
:host([theme~='overflow-indicator-bottom'][overflow~='bottom'])::after {
5557
display: block;
5658
}
5759
`;
557 Bytes
Loading
565 Bytes
Loading
594 Bytes
Loading

packages/scroller/test/visual/base/scroller.test.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { sendKeys } from '@vaadin/test-runner-commands';
22
import { fixtureSync } from '@vaadin/testing-helpers';
33
import { visualDiff } from '@web/test-runner-visual-regression';
4-
import '../hide-scrollbar.js';
54
import '../../../src/vaadin-scroller.js';
65

76
describe('scroller', () => {
@@ -31,7 +30,7 @@ describe('scroller', () => {
3130
});
3231

3332
it('theme-overflow-indicators-bottom', async () => {
34-
element.setAttribute('theme', 'overflow-indicators');
33+
element.setAttribute('theme', 'overflow-indicator-bottom');
3534
await visualDiff(div, 'theme-overflow-indicators-bottom');
3635
});
3736

@@ -42,7 +41,7 @@ describe('scroller', () => {
4241
});
4342

4443
it('theme-overflow-indicators-top', async () => {
45-
element.setAttribute('theme', 'overflow-indicators');
44+
element.setAttribute('theme', 'overflow-indicator-top');
4645
element.scrollTop = element.scrollHeight - element.clientHeight;
4746
await visualDiff(div, 'theme-overflow-indicators-top');
4847
});

packages/scroller/test/visual/hide-scrollbar.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themab
44
registerStyles(
55
'vaadin-scroller',
66
css`
7-
:host([theme~='overflow-indicators'])::-webkit-scrollbar {
7+
:host([theme*='overflow-indicator'])::-webkit-scrollbar {
88
display: none;
99
}
1010
`,
-4.88 KB
Loading
-4.87 KB
Loading
-4.87 KB
Loading

0 commit comments

Comments
 (0)