Skip to content

Commit 42f4cc7

Browse files
sujal12344Copilot
andauthored
feat(styles): add global scrollbar styling with theme awareness (#1158)
* feat(styles): add global scrollbar styling with theme awareness #1157 * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * fix(update): color value update --------- Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent 195155b commit 42f4cc7

1 file changed

Lines changed: 64 additions & 0 deletions

File tree

website/src/css/custom.css

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5383,6 +5383,70 @@ nav.table-of-contents .table-of-contents__link--active,
53835383
background-color: rgba(156, 163, 175, 0.5);
53845384
}
53855385

5386+
/* Global scrollbar styling - theme-aware */
5387+
* {
5388+
scrollbar-width: thin;
5389+
scrollbar-color: rgba(75, 85, 99, 0.4) transparent;
5390+
}
5391+
5392+
*::-webkit-scrollbar {
5393+
width: 8px;
5394+
height: 8px;
5395+
}
5396+
5397+
*::-webkit-scrollbar-track {
5398+
background: transparent;
5399+
}
5400+
5401+
*::-webkit-scrollbar-thumb {
5402+
background-color: rgba(75, 85, 99, 0.4);
5403+
border-radius: 4px;
5404+
border: 2px solid transparent;
5405+
background-clip: padding-box;
5406+
}
5407+
5408+
*::-webkit-scrollbar-thumb:hover {
5409+
background-color: rgba(75, 85, 99, 0.6);
5410+
}
5411+
5412+
*::-webkit-scrollbar-corner {
5413+
background: transparent;
5414+
}
5415+
5416+
/* Dark mode global scrollbar */
5417+
[data-theme="dark"] * {
5418+
scrollbar-color: rgba(107, 114, 128, 0.5) rgba(0, 0, 0, 0.2);
5419+
}
5420+
5421+
[data-theme="dark"] *::-webkit-scrollbar-thumb {
5422+
background-color: rgba(107, 114, 128, 0.5);
5423+
}
5424+
5425+
[data-theme="dark"] *::-webkit-scrollbar-thumb:hover {
5426+
background-color: rgba(107, 114, 128, 0.7);
5427+
}
5428+
5429+
[data-theme="dark"] *::-webkit-scrollbar-track {
5430+
background: rgba(0, 0, 0, 0.2);
5431+
}
5432+
5433+
/* Light mode global scrollbar */
5434+
[data-theme="light"] *:not(.tableOfContents) {
5435+
scrollbar-color: rgba(55, 65, 81, 0.4) rgba(229, 231, 235, 0.5);
5436+
}
5437+
5438+
[data-theme="light"] *:not(.tableOfContents)::-webkit-scrollbar-thumb {
5439+
background-color: rgba(55, 65, 81, 0.4);
5440+
}
5441+
5442+
[data-theme="light"] *:not(.tableOfContents)::-webkit-scrollbar-thumb:hover {
5443+
background-color: rgba(55, 65, 81, 0.6);
5444+
}
5445+
5446+
[data-theme="light"] *:not(.tableOfContents)::-webkit-scrollbar-track {
5447+
background: rgba(229, 231, 235, 0.5);
5448+
}
5449+
53865450
/* Animate the active TOC item */
53875451
.table-of-contents__link--active {
53885452
transition: all 0.2s ease;

0 commit comments

Comments
 (0)