Skip to content

Commit 60d3bff

Browse files
Fix white playground border
1 parent 753504b commit 60d3bff

File tree

2 files changed

+32
-5
lines changed

2 files changed

+32
-5
lines changed

src/Playground.res

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ module ResultPane = {
364364
~focusedRowCol: option<(int, int)>=?,
365365
~result: FinalResult.t,
366366
) =>
367-
<div className="pt-4 bg-0 overflow-y-auto">
367+
<div className="pt-4 bg-0 overflow-y-auto playground-scrollbar">
368368
<div className="flex items-center text-16 font-medium px-4">
369369
<div className="pr-4"> {renderTitle(result)} </div>
370370
</div>
@@ -765,7 +765,7 @@ module WarningFlagsWidget = {
765765
Option.map(suggestions, elements =>
766766
<div
767767
ref={ReactDOM.Ref.domRef((Obj.magic(listboxRef): React.ref<Nullable.t<Dom.element>>))}
768-
className="p-2 absolute overflow-auto z-50 border-b rounded border-l border-r block w-full bg-gray-100 max-h-60"
768+
className="p-2 absolute overflow-auto playground-scrollbar z-50 border-b rounded border-l border-r block w-full bg-gray-100 max-h-60"
769769
>
770770
elements
771771
</div>
@@ -1932,7 +1932,9 @@ let make = (~bundleBaseUrl: string, ~versions: array<string>) => {
19321932
<button key={Int.toString(i)} onClick className disabled> {title} </button>
19331933
})
19341934

1935-
<main className={"flex flex-col bg-gray-100 text-gray-40 text-14 overflow-scroll mt-16"}>
1935+
<main className={
1936+
"flex flex-col bg-gray-100 text-gray-40 text-14 overflow-scroll playground-scrollbar mt-16"
1937+
}>
19361938
<ControlPanel
19371939
actionIndicatorKey={Int.toString(actionCount)}
19381940
state=compilerState
@@ -1947,7 +1949,7 @@ let make = (~bundleBaseUrl: string, ~versions: array<string>) => {
19471949
// Left Panel
19481950
<div
19491951
ref={ReactDOM.Ref.domRef((Obj.magic(leftPanelRef): React.ref<Nullable.t<Dom.element>>))}
1950-
className={`overflow-scroll ${layout == Column ? "h-2/4" : "h-full!"} ${layout == Column
1952+
className={`overflow-scroll playground-scrollbar ${layout == Column ? "h-2/4" : "h-full!"} ${layout == Column
19511953
? "w-full"
19521954
: "w-[50%]"}`}
19531955
>
@@ -2003,7 +2005,7 @@ let make = (~bundleBaseUrl: string, ~versions: array<string>) => {
20032005
</div>
20042006
<div
20052007
ref={ReactDOM.Ref.domRef((Obj.magic(subPanelRef): React.ref<Nullable.t<Dom.element>>))}
2006-
className="overflow-auto"
2008+
className="overflow-auto playground-scrollbar"
20072009
>
20082010
<OutputPanel
20092011
currentTab compilerDispatch compilerState editorCode keyMapState={(keyMap, setKeyMap)}

styles/main.css

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,31 @@
294294
/* Chrome/Safari/Webkit */
295295
}
296296

297+
.playground-scrollbar {
298+
scrollbar-width: thin;
299+
scrollbar-color: var(--color-gray-70) var(--color-gray-100);
300+
scrollbar-gutter: stable; /* Reserve only at the scrollbar edge to avoid padding shifts */
301+
}
302+
303+
.playground-scrollbar::-webkit-scrollbar {
304+
width: 0.65rem;
305+
height: 0.65rem;
306+
}
307+
308+
.playground-scrollbar::-webkit-scrollbar-track {
309+
background: var(--color-gray-100);
310+
}
311+
312+
.playground-scrollbar::-webkit-scrollbar-thumb {
313+
background-color: var(--color-gray-70);
314+
border-radius: 9999px;
315+
border: 2px solid var(--color-gray-100);
316+
}
317+
318+
.playground-scrollbar::-webkit-scrollbar-thumb:hover {
319+
background-color: var(--color-gray-60);
320+
}
321+
297322
a > code {
298323
@apply text-fire;
299324
}

0 commit comments

Comments
 (0)