Skip to content

Commit f4301b8

Browse files
fix(ui5-dialog): Fixed scrollbars styling (#3067)
Fixes: #2887
1 parent 573a6c6 commit f4301b8

File tree

4 files changed

+28
-3
lines changed

4 files changed

+28
-3
lines changed

packages/main/src/Dialog.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import Icon from "./Icon.js";
88
// Template
99
import DialogTemplate from "./generated/templates/DialogTemplate.lit.js";
1010
// Styles
11+
import browserScrollbarCSS from "./generated/themes/BrowserScrollbar.css.js";
1112
import PopupsCommonCss from "./generated/themes/PopupsCommon.css.js";
1213
import dialogCSS from "./generated/themes/Dialog.css.js";
1314

@@ -180,7 +181,7 @@ class Dialog extends Popup {
180181
}
181182

182183
static get styles() {
183-
return [PopupsCommonCss, dialogCSS];
184+
return [browserScrollbarCSS, PopupsCommonCss, dialogCSS];
184185
}
185186

186187
/**

packages/main/src/Popover.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { addOpenedPopover, removeOpenedPopover } from "./popup-utils/PopoverRegi
1111
// Template
1212
import PopoverTemplate from "./generated/templates/PopoverTemplate.lit.js";
1313
// Styles
14+
import browserScrollbarCSS from "./generated/themes/BrowserScrollbar.css.js";
1415
import PopupsCommonCss from "./generated/themes/PopupsCommon.css.js";
1516
import PopoverCss from "./generated/themes/Popover.css.js";
1617

@@ -263,7 +264,7 @@ class Popover extends Popup {
263264
}
264265

265266
static get styles() {
266-
return [PopupsCommonCss, PopoverCss];
267+
return [browserScrollbarCSS, PopupsCommonCss, PopoverCss];
267268
}
268269

269270
static get template() {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
::-webkit-scrollbar:horizontal {
2+
height: var(--sapScrollBar_Dimension);
3+
}
4+
5+
::-webkit-scrollbar:vertical {
6+
width: var(--sapScrollBar_Dimension);
7+
}
8+
9+
::-webkit-scrollbar {
10+
background-color: var(--sapScrollBar_TrackColor);
11+
}
12+
13+
::-webkit-scrollbar-thumb {
14+
background-color: var(--sapScrollBar_FaceColor);
15+
}
16+
17+
::-webkit-scrollbar-thumb:hover {
18+
background-color: var(--sapScrollBar_Hover_FaceColor);
19+
}
20+
21+
::-webkit-scrollbar-corner {
22+
background-color: var(--sapScrollBar_TrackColor);
23+
}

packages/main/test/pages/Dialog.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656

5757
<ui5-block-layer></ui5-block-layer>
5858

59-
<ui5-dialog id="msg-dialog" header-text="Message dialog">
59+
<ui5-dialog id="msg-dialog" header-text="Message dialog" style="--sapScrollBar_Dimension: 20px">
6060
<p>Build enterprise-ready web applications, responsive to all devices and running on the browser of your choice.
6161
That´s OpenUI5.</p>
6262
<p>Build enterprise-ready web applications, responsive to all devices and running on the browser of your choice.

0 commit comments

Comments
 (0)