mirror of
https://github.com/simstudioai/sim.git
synced 2026-09-24 15:45:35 +08:00
fix(ui): scrollbar styling across all browsers
This commit is contained in:
@@ -33,6 +33,12 @@
|
||||
--ring: 222.2 84% 4.9%;
|
||||
|
||||
--radius: 0.5rem;
|
||||
|
||||
/* Scrollbar Custom Properties */
|
||||
--scrollbar-track: 0 0% 85%;
|
||||
--scrollbar-thumb: 0 0% 65%;
|
||||
--scrollbar-thumb-hover: 0 0% 55%;
|
||||
--scrollbar-size: 8px;
|
||||
}
|
||||
|
||||
.dark {
|
||||
@@ -63,6 +69,11 @@
|
||||
--border: 217.2 32.6% 17.5%;
|
||||
--input: 217.2 32.6% 17.5%;
|
||||
--ring: 212.7 26.8% 83.9%;
|
||||
|
||||
/* Dark Mode Scrollbar Custom Properties */
|
||||
--scrollbar-track: 217.2 32.6% 17.5%;
|
||||
--scrollbar-thumb: 217.2 32.6% 30%;
|
||||
--scrollbar-thumb-hover: 217.2 32.6% 40%;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,6 +87,32 @@
|
||||
@apply bg-background text-foreground;
|
||||
overscroll-behavior-x: none;
|
||||
}
|
||||
|
||||
/* Global Scrollbar Styling */
|
||||
::-webkit-scrollbar {
|
||||
width: var(--scrollbar-size);
|
||||
height: var(--scrollbar-size);
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-track {
|
||||
background-color: hsl(var(--scrollbar-track));
|
||||
border-radius: var(--radius);
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb {
|
||||
background-color: hsl(var(--scrollbar-thumb));
|
||||
border-radius: var(--radius);
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb:hover {
|
||||
background-color: hsl(var(--scrollbar-thumb-hover));
|
||||
}
|
||||
|
||||
/* For Firefox */
|
||||
* {
|
||||
scrollbar-width: thin;
|
||||
scrollbar-color: hsl(var(--scrollbar-thumb)) hsl(var(--scrollbar-track));
|
||||
}
|
||||
}
|
||||
|
||||
/* Custom Animations */
|
||||
@@ -101,6 +138,16 @@
|
||||
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
||||
transition-duration: 300ms;
|
||||
}
|
||||
|
||||
/* Custom Scrollbar Utility Classes */
|
||||
.scrollbar-none {
|
||||
-ms-overflow-style: none;
|
||||
scrollbar-width: none;
|
||||
}
|
||||
|
||||
.scrollbar-none::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
/* Dark mode error badge styling */
|
||||
|
||||
+1
-1
@@ -195,7 +195,7 @@ export function LongInput({
|
||||
/>
|
||||
<div
|
||||
ref={overlayRef}
|
||||
className="absolute inset-0 pointer-events-none px-3 py-2 overflow-auto whitespace-pre-wrap break-words scrollbar-none text-sm bg-transparent box-border"
|
||||
className="absolute inset-0 pointer-events-none px-3 py-2 overflow-auto whitespace-pre-wrap break-words text-sm bg-transparent box-border"
|
||||
style={{ width: 'calc(100% - 2px)' }}
|
||||
>
|
||||
{formatDisplayText(value?.toString() ?? '')}
|
||||
|
||||
+1
-1
@@ -310,7 +310,7 @@ export function ShortInput({
|
||||
/>
|
||||
<div
|
||||
ref={overlayRef}
|
||||
className="absolute inset-0 pointer-events-none px-3 flex items-center overflow-x-auto whitespace-pre scrollbar-none text-sm bg-transparent"
|
||||
className="absolute inset-0 pointer-events-none px-3 flex items-center overflow-x-auto whitespace-pre text-sm bg-transparent"
|
||||
>
|
||||
{password && !isFocused
|
||||
? '•'.repeat(value?.toString().length ?? 0)
|
||||
|
||||
@@ -147,7 +147,7 @@ export function Table({ columns, blockId, subBlockId }: TableProps) {
|
||||
}}
|
||||
className="border-0 focus-visible:ring-0 focus-visible:ring-offset-0 text-transparent caret-foreground placeholder:text-muted-foreground/50"
|
||||
/>
|
||||
<div className="absolute inset-0 pointer-events-none px-3 flex items-center overflow-x-auto whitespace-pre scrollbar-none text-sm bg-transparent">
|
||||
<div className="absolute inset-0 pointer-events-none px-3 flex items-center overflow-x-auto whitespace-pre text-sm bg-transparent">
|
||||
{formatDisplayText(cellValue)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -448,7 +448,7 @@ function WorkflowContent() {
|
||||
onDragOver={(e) => e.preventDefault()}
|
||||
fitView
|
||||
minZoom={0.1}
|
||||
maxZoom={1}
|
||||
maxZoom={1.3}
|
||||
panOnScroll
|
||||
defaultEdgeOptions={{ type: 'custom' }}
|
||||
proOptions={{ hideAttribution: true }}
|
||||
|
||||
Reference in New Issue
Block a user