Skip to content

Commit 49edc02

Browse files
authored
Merge pull request #935 from refly-ai/feat/improve-scroll-bar
style: enhance scrollbar styles and improve dark mode support
2 parents 20ade85 + e233f68 commit 49edc02

File tree

2 files changed

+51
-21
lines changed

2 files changed

+51
-21
lines changed

apps/web/src/styles/style.css

Lines changed: 50 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -63,34 +63,64 @@ select:focus {
6363
content: none !important;
6464
}
6565

66-
::-webkit-scrollbar {
67-
width: 8px;
68-
height: 8px;
69-
}
70-
71-
::-webkit-scrollbar-track {
72-
background: #f1f1f1;
73-
}
66+
/* Scrollbar Styles - Only show during scrolling */
67+
@media (hover: hover) {
68+
* {
69+
scrollbar-width: auto;
70+
scrollbar-color: transparent transparent;
71+
}
7472

75-
::-webkit-scrollbar-thumb {
76-
background: #c1c1c1;
77-
border-radius: 4px;
78-
}
73+
*:hover,
74+
*:focus,
75+
*:focus-within {
76+
scrollbar-color: #c1c1c1 #f1f1f1;
77+
}
7978

80-
::-webkit-scrollbar-thumb:hover {
81-
background: #a8a8a8;
82-
}
79+
::-webkit-scrollbar {
80+
width: 8px;
81+
height: 8px;
82+
}
8383

84-
.dark {
8584
::-webkit-scrollbar-track {
86-
background: #2d2d2d;
85+
background: #f1f1f1;
8786
}
8887

8988
::-webkit-scrollbar-thumb {
90-
background: #555;
89+
background-color: transparent;
90+
border-radius: 4px;
91+
}
92+
93+
*:hover::-webkit-scrollbar-thumb,
94+
*:focus::-webkit-scrollbar-thumb,
95+
*:focus-within::-webkit-scrollbar-thumb,
96+
*::-webkit-scrollbar-thumb:hover {
97+
background-color: #c1c1c1;
98+
transition: background-color 0.3s ease;
99+
}
100+
101+
*::-webkit-scrollbar-thumb:hover {
102+
background-color: #a8a8a8;
103+
}
104+
105+
.dark *:hover,
106+
.dark *:focus,
107+
.dark *:focus-within {
108+
scrollbar-color: #555 #2d2d2d;
109+
}
110+
111+
.dark ::-webkit-scrollbar-track {
112+
background: #2d2d2d;
113+
}
114+
115+
.dark *:hover::-webkit-scrollbar-thumb,
116+
.dark *:focus::-webkit-scrollbar-thumb,
117+
.dark *:focus-within::-webkit-scrollbar-thumb,
118+
.dark *::-webkit-scrollbar-thumb:hover {
119+
background-color: #555;
120+
transition: background-color 0.3s ease;
91121
}
92122

93-
::-webkit-scrollbar-thumb:hover {
94-
background: #777;
123+
.dark *::-webkit-scrollbar-thumb:hover {
124+
background-color: #777;
95125
}
96126
}

packages/ai-workspace-common/src/modules/artifacts/code-runner/monaco-editor/SimpleTextEditor.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ const SimpleTextEditor = React.memo(
4343
</div>
4444

4545
{isContentTruncated && (
46-
<div className="bg-yellow-50 text-yellow-800 px-4 py-2 text-sm dark:bg-yellow-850 dark:text-yellow-100">
46+
<div className="bg-yellow-50 text-yellow-800 px-4 py-2 text-sm dark:bg-yellow-50 dark:text-yellow-600">
4747
{t('codeArtifact.editor.contentTruncated', {
4848
chars: DEFAULT_MAX_GENERATION_DISPLAY,
4949
total: content.length,

0 commit comments

Comments
 (0)