Skip to content

Commit e20dd73

Browse files
authored
Implement custom scrollbar styles for themes
Added custom scrollbar styles for light and dark themes, including hover effects and Firefox fallbacks.
1 parent 4345420 commit e20dd73

1 file changed

Lines changed: 48 additions & 0 deletions

File tree

src/css/custom.css

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1984,3 +1984,51 @@ h3:first-child {
19841984
margin-top: 0;
19851985
margin-bottom: 1rem;
19861986
}
1987+
1988+
/* --- CUSTOM MODERN SCROLLBAR --- */
1989+
1990+
::-webkit-scrollbar {
1991+
width: 8px;
1992+
height: 10px;
1993+
}
1994+
1995+
/* --- LIGHT THEME --- */
1996+
html[data-theme="light"] ::-webkit-scrollbar-track {
1997+
background: transparent;
1998+
}
1999+
2000+
html[data-theme="light"] ::-webkit-scrollbar-thumb {
2001+
background-color: #944A8C;
2002+
border: 2px solid var(--ifm-background-color);
2003+
border-radius: 10px;
2004+
}
2005+
2006+
html[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
2007+
background-color: #60226E;
2008+
}
2009+
2010+
/* --- DARK THEME --- */
2011+
html[data-theme="dark"] ::-webkit-scrollbar-track {
2012+
background: transparent;
2013+
}
2014+
2015+
html[data-theme="dark"] ::-webkit-scrollbar-thumb {
2016+
background-color: #944A8C;
2017+
border: 2px solid var(--ifm-background-color);
2018+
border-radius: 10px;
2019+
}
2020+
2021+
html[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
2022+
background-color: #60226E;
2023+
}
2024+
2025+
/* --- FIREFOX FALLBACKS --- */
2026+
html[data-theme="light"] * {
2027+
scrollbar-width: thin;
2028+
scrollbar-color: #944A8C transparent;
2029+
}
2030+
2031+
html[data-theme="dark"] * {
2032+
scrollbar-width: thin;
2033+
scrollbar-color: #944A8C transparent;
2034+
}

0 commit comments

Comments
 (0)