File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed
Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,24 @@ import Error404 from "../pages/errors/error404/Error";
1212import ResumePage from "../pages/resume/Resume.js" ;
1313
1414export default class Main extends Component {
15+ componentDidMount ( ) {
16+ document . documentElement . style . setProperty (
17+ "--scrollbar-color" ,
18+ this . props . theme . imageHighlight
19+ ) ;
20+ }
21+ componentDidUpdate ( prevProps ) {
22+ if (
23+ prevProps . theme &&
24+ this . props . theme &&
25+ prevProps . theme . imageHighlight !== this . props . theme . imageHighlight
26+ ) {
27+ document . documentElement . style . setProperty (
28+ "--scrollbar-color" ,
29+ this . props . theme . imageHighlight
30+ ) ;
31+ }
32+ }
1533 render ( ) {
1634 return (
1735 < BrowserRouter basename = "/" >
Original file line number Diff line number Diff line change @@ -63,3 +63,11 @@ body {
6363 line-height : normal;
6464 }
6565}
66+
67+ : root {
68+ --scrollbar-color : white; /* it will change when the page loads*/
69+ }
70+ * {
71+ scrollbar-width : thin;
72+ scrollbar-color : var (--scrollbar-color ) transparent;
73+ }
You can’t perform that action at this time.
0 commit comments