feat: add custom scrollbar styles for light and dark themes
- Implemented custom scrollbar styles in src/index.css for improved aesthetics. - Added styles for both light and dark themes, enhancing user experience across different modes.
This commit is contained in:
@@ -117,4 +117,51 @@
|
||||
body {
|
||||
@apply bg-background text-foreground;
|
||||
}
|
||||
}
|
||||
|
||||
/* 自定义滚动条样式 */
|
||||
* {
|
||||
scrollbar-width: thin;
|
||||
scrollbar-color: oklch(0.551 0.027 264.364 / 0.3) transparent;
|
||||
}
|
||||
|
||||
*::-webkit-scrollbar {
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
}
|
||||
|
||||
*::-webkit-scrollbar-track {
|
||||
background: transparent;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
*::-webkit-scrollbar-thumb {
|
||||
background: oklch(0.551 0.027 264.364 / 0.3);
|
||||
border-radius: 4px;
|
||||
transition: background 0.2s ease;
|
||||
}
|
||||
|
||||
*::-webkit-scrollbar-thumb:hover {
|
||||
background: oklch(0.551 0.027 264.364 / 0.5);
|
||||
}
|
||||
|
||||
*::-webkit-scrollbar-thumb:active {
|
||||
background: oklch(0.551 0.027 264.364 / 0.6);
|
||||
}
|
||||
|
||||
/* 深色模式下的滚动条 */
|
||||
.dark *::-webkit-scrollbar-thumb {
|
||||
background: oklch(0.707 0.022 261.325 / 0.4);
|
||||
}
|
||||
|
||||
.dark *::-webkit-scrollbar-thumb:hover {
|
||||
background: oklch(0.707 0.022 261.325 / 0.6);
|
||||
}
|
||||
|
||||
.dark *::-webkit-scrollbar-thumb:active {
|
||||
background: oklch(0.707 0.022 261.325 / 0.7);
|
||||
}
|
||||
|
||||
.dark * {
|
||||
scrollbar-color: oklch(0.707 0.022 261.325 / 0.4) transparent;
|
||||
}
|
||||
Reference in New Issue
Block a user