mirror of
https://github.com/stackblitz-labs/bolt.diy
synced 2025-06-04 03:26:33 +00:00
style: add modern-scrollbar class to improve scrollbar appearance
Introduce the modern-scrollbar class to enhance the visual consistency of scrollbars across the application. This class provides a cleaner and more modern look for scrollbars in WebKit and Firefox browsers.
This commit is contained in:
parent
e30035cec5
commit
9454c73992
@ -413,7 +413,7 @@ export const ControlPanel = ({ open, onClose }: ControlPanelProps) => {
|
||||
return (
|
||||
<RadixDialog.Root open={open}>
|
||||
<RadixDialog.Portal>
|
||||
<div className="fixed inset-0 flex items-center justify-center z-[100]">
|
||||
<div className="fixed inset-0 flex items-center justify-center z-[100] modern-scrollbar">
|
||||
<RadixDialog.Overlay asChild>
|
||||
<motion.div
|
||||
className="absolute inset-0 bg-black/70 dark:bg-black/80 backdrop-blur-sm"
|
||||
|
@ -348,7 +348,7 @@ export const BaseChat = React.forwardRef<HTMLDivElement, BaseChatProps>(
|
||||
</div>
|
||||
)}
|
||||
<StickToBottom
|
||||
className={classNames('pt-6 px-2 sm:px-6 relative', {
|
||||
className={classNames('modern-scrollbar pt-6 px-2 sm:px-6 relative', {
|
||||
'h-full flex flex-col': chatStarted,
|
||||
})}
|
||||
resize="smooth"
|
||||
|
@ -114,7 +114,7 @@ export const EditorPanel = memo(
|
||||
</div>
|
||||
)}
|
||||
</PanelHeader>
|
||||
<div className="h-full flex-1 overflow-hidden">
|
||||
<div className="h-full flex-1 overflow-hidden modern-scrollbar">
|
||||
<CodeMirrorEditor
|
||||
theme={theme}
|
||||
editable={!isStreaming && editorDocument !== undefined}
|
||||
|
@ -143,7 +143,7 @@ export const FileTree = memo(
|
||||
};
|
||||
|
||||
return (
|
||||
<div className={classNames('text-sm', className, 'overflow-y-auto')}>
|
||||
<div className={classNames('text-sm', className, 'overflow-y-auto modern-scrollbar')}>
|
||||
{filteredFileList.map((fileOrFolder) => {
|
||||
switch (fileOrFolder.kind) {
|
||||
case 'file': {
|
||||
|
@ -150,7 +150,7 @@ export const TerminalTabs = memo(() => {
|
||||
<Terminal
|
||||
key={index}
|
||||
id={`terminal_${index}`}
|
||||
className={classNames('h-full overflow-hidden', {
|
||||
className={classNames('h-full overflow-hidden modern-scrollbar-invert', {
|
||||
hidden: !isActive,
|
||||
})}
|
||||
ref={(ref) => {
|
||||
@ -166,7 +166,7 @@ export const TerminalTabs = memo(() => {
|
||||
<Terminal
|
||||
key={index}
|
||||
id={`terminal_${index}`}
|
||||
className={classNames('h-full overflow-hidden', {
|
||||
className={classNames('modern-scrollbar h-full overflow-hidden', {
|
||||
hidden: !isActive,
|
||||
})}
|
||||
ref={(ref) => {
|
||||
|
@ -22,3 +22,51 @@ body {
|
||||
// --secondary-color: rgba(138, 43, 226, var(--gradient-opacity));
|
||||
// --accent-color: rgba(180, 170, 220, var(--gradient-opacity));
|
||||
}
|
||||
|
||||
.modern-scrollbar {
|
||||
overflow: auto;
|
||||
|
||||
// WebKit scrollbar styling
|
||||
&::-webkit-scrollbar {
|
||||
width: 2px;
|
||||
height: 4px;
|
||||
}
|
||||
|
||||
&::-webkit-scrollbar-track {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
&::-webkit-scrollbar-thumb {
|
||||
// Use CSS variables for colors
|
||||
background-color: var(--modern-scrollbar-thumb-background);
|
||||
border-radius: 9999px; // pill shape
|
||||
border: 2px solid transparent; // for padding-like effect
|
||||
background-clip: content-box;
|
||||
transition: background-color 0.2s ease-in-out; // Add transition
|
||||
}
|
||||
|
||||
&::-webkit-scrollbar-thumb:hover {
|
||||
// Use CSS variable for hover color
|
||||
background-color: var(--modern-scrollbar-thumb-backgroundHover);
|
||||
}
|
||||
|
||||
// Firefox support
|
||||
scrollbar-width: thin;
|
||||
// Use CSS variables for Firefox colors
|
||||
scrollbar-color: var(--modern-scrollbar-thumb-backgroundHover) transparent; // Use hover color for thumb for consistency
|
||||
}
|
||||
|
||||
.modern-scrollbar-invert {
|
||||
&::-webkit-scrollbar-thumb {
|
||||
// Override with a contrasting color, e.g., primary text color with transparency
|
||||
background-color: color-mix(in srgb, var(--bolt-elements-textPrimary), transparent 70%);
|
||||
}
|
||||
|
||||
&::-webkit-scrollbar-thumb:hover {
|
||||
// Darker/more opaque version on hover
|
||||
background-color: color-mix(in srgb, var(--bolt-elements-textPrimary), transparent 50%);
|
||||
}
|
||||
|
||||
// Firefox support for inverted colors
|
||||
scrollbar-color: color-mix(in srgb, var(--bolt-elements-textPrimary), transparent 50%) transparent;
|
||||
}
|
@ -102,6 +102,8 @@
|
||||
--bolt-terminal-brightMagenta: #bc05bc;
|
||||
--bolt-terminal-brightCyan: #0598bc;
|
||||
--bolt-terminal-brightWhite: #a5a5a5;
|
||||
--modern-scrollbar-thumb-background: rgba(100, 100, 100, 0.3); // Example light theme color
|
||||
--modern-scrollbar-thumb-backgroundHover: rgba(74, 74, 74, 0.8);
|
||||
}
|
||||
|
||||
/* Color Tokens Dark Theme */
|
||||
@ -208,6 +210,8 @@
|
||||
--bolt-terminal-brightMagenta: #ff6ac1;
|
||||
--bolt-terminal-brightCyan: #9aedfe;
|
||||
--bolt-terminal-brightWhite: #f1f1f0;
|
||||
--modern-scrollbar-thumb-background: rgba(100, 100, 100, 0.3); // Example dark theme color (adjust as needed)
|
||||
--modern-scrollbar-thumb-backgroundHover: rgba(10, 10, 10, 0.8);
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user