Skip to content

Commit 771a7bf

Browse files
committed
[devtools] add correct scrollbar to dialog body
1 parent d845c1e commit 771a7bf

File tree

2 files changed

+44
-4
lines changed

2 files changed

+44
-4
lines changed

packages/next/src/next-devtools/dev-overlay/components/devtools-panel/devtools-panel.tsx

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ export function DevToolsPanel({
143143
</div>
144144
</div>
145145
</DialogHeader>
146-
<DialogBody>
146+
<DialogBody data-nextjs-devtools-panel-dialog-body>
147147
<DevToolsPanelTab
148148
activeTab={activeTab}
149149
devToolsPosition={state.devToolsPosition}
@@ -167,11 +167,51 @@ export function DevToolsPanel({
167167
}
168168

169169
export const DEVTOOLS_PANEL_STYLES = css`
170+
[data-nextjs-devtools-panel-dialog-body] {
171+
overflow-y: auto;
172+
}
173+
174+
[data-nextjs-devtools-panel-dialog-body],
175+
[data-nextjs-devtools-panel-dialog-body] * {
176+
&::-webkit-scrollbar {
177+
width: 6px;
178+
height: 6px;
179+
border-radius: 0 0 1rem 1rem;
180+
margin-bottom: 1rem;
181+
}
182+
183+
&::-webkit-scrollbar-button {
184+
display: none;
185+
}
186+
187+
&::-webkit-scrollbar-track {
188+
border-radius: 0 0 1rem 1rem;
189+
background-color: var(--color-background-100);
190+
}
191+
192+
&::-webkit-scrollbar-thumb {
193+
border-radius: 1rem;
194+
background-color: var(--color-gray-500);
195+
}
196+
}
197+
170198
/* TODO: Better override dialog header style. This conflicts with issues tab content. */
171199
[data-nextjs-devtools-panel-dialog-header] {
172200
margin-bottom: 0 !important;
173201
}
174202
203+
/* Make DialogContent expand to push footer to bottom */
204+
[data-nextjs-devtools-panel-dialog] [data-nextjs-dialog-content] {
205+
flex: 1;
206+
overflow: hidden;
207+
}
208+
209+
/* Make DialogBody a flex container so its children can expand */
210+
[data-nextjs-devtools-panel-dialog] [data-nextjs-dialog-body] {
211+
display: flex;
212+
flex-direction: column;
213+
}
214+
175215
[data-nextjs-devtools-panel-overlay] {
176216
padding: initial;
177217
margin: auto;
@@ -216,7 +256,6 @@ export const DEVTOOLS_PANEL_STYLES = css`
216256
border-radius: var(--rounded-xl);
217257
box-shadow: var(--shadow-lg);
218258
position: relative;
219-
overflow-y: auto;
220259
width: 100%;
221260
max-height: 50vh;
222261
min-height: 450px;

packages/next/src/next-devtools/dev-overlay/components/dialog/dialog-body.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@ import * as React from 'react'
33
export type DialogBodyProps = {
44
children?: React.ReactNode
55
className?: string
6-
}
6+
} & React.HTMLAttributes<HTMLDivElement>
77

88
const DialogBody: React.FC<DialogBodyProps> = function DialogBody({
99
children,
1010
className,
11+
...props
1112
}) {
1213
return (
13-
<div data-nextjs-dialog-body className={className}>
14+
<div data-nextjs-dialog-body className={className} {...props}>
1415
{children}
1516
</div>
1617
)

0 commit comments

Comments
 (0)