Skip to content
This repository was archived by the owner on May 20, 2023. It is now read-only.

Commit fb758bf

Browse files
Googlernshahan
authored andcommitted
Allow material scrollbar mixin to be used in global css (without angular).
PiperOrigin-RevId: 179607094
1 parent d39bfa9 commit fb758bf

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

lib/css/material/_mixins.scss

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,21 @@
1515
$thumb-hover-color,
1616
$scrollbar-size: $mat-grid-type,
1717
$thumb-min-size: 6 * $mat-grid) {
18-
::ng-deep ::-webkit-scrollbar {
18+
::ng-deep {
19+
@include material-scrollbar(
20+
$thumb-hover-color, $scrollbar-size, $thumb-min-size);
21+
}
22+
}
23+
24+
/// Style all scrollbars within the scope to material spec.
25+
///
26+
/// Note: This is the same as material-scrollbar-theme expect it can be used
27+
/// globally outside the context angular components.
28+
@mixin material-scrollbar(
29+
$thumb-hover-color,
30+
$scrollbar-size: $mat-grid-type,
31+
$thumb-min-size: 6 * $mat-grid) {
32+
::-webkit-scrollbar {
1933
background-color: $mat-scrollbar-background;
2034

2135
// Height only applies to horizontal scrollbars.
@@ -29,7 +43,7 @@
2943
}
3044
}
3145

32-
::ng-deep ::-webkit-scrollbar-thumb {
46+
::-webkit-scrollbar-thumb {
3347
background-color: $mat-scrollbar-thumb;
3448

3549
// min-height only applies to vertical scrollbar thumbs.
@@ -43,7 +57,7 @@
4357
}
4458
}
4559

46-
::ng-deep ::-webkit-scrollbar-button {
60+
::-webkit-scrollbar-button {
4761
width: 0;
4862
height: 0;
4963
}

0 commit comments

Comments
 (0)