Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/twelve-bears-clean.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"gitbook": patch
---

Fix OpenAPI response dropdown & vertical overflow
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const CodeBlockRenderer = forwardRef(function CodeBlockRenderer(
<div
ref={ref}
aria-busy={ariaBusy}
className={tcls('group/codeblock grid grid-flow-col', style)}
className={tcls('group/codeblock grid shrink grid-flow-col overflow-hidden', style)}
>
<div className="flex items-center justify-start gap-2 text-sm [grid-area:1/1]">
{title ? (
Expand Down
28 changes: 22 additions & 6 deletions packages/gitbook/src/components/DocumentView/OpenAPI/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,11 @@
}

.openapi-column-preview {
@apply flex flex-col flex-1;
@apply flex flex-col flex-1 xl:max-2xl:pt-20 lg:py-6 sticky max-h-[calc(100vh-var(--toc-top-offset))] top-(--toc-top-offset);
}

.openapi-column-preview-body {
@apply flex flex-col gap-4 sticky top-[calc(var(--toc-top-offset)+5rem)] print-mode:static;
@apply flex flex-col shrink overflow-hidden gap-4 print-mode:static;
}

.openapi-column-preview pre {
Expand Down Expand Up @@ -510,13 +510,21 @@
.openapi-panel,
.openapi-codesample,
.openapi-response-examples {
@apply border rounded-md straight-corners:rounded-none circular-corners:rounded-xl bg-tint-subtle border-tint-subtle shadow-sm;
@apply border shrink min-h-40 overflow-hidden rounded-md straight-corners:rounded-none circular-corners:rounded-xl bg-tint-subtle border-tint-subtle shadow-sm;
}

.openapi-response-examples-panel {
@apply flex flex-col shrink overflow-hidden;
}

.openapi-codesample-panel {
@apply flex flex-col shrink overflow-hidden;
}

.openapi-panel pre,
.openapi-codesample pre,
.openapi-response-examples pre {
@apply bg-transparent border-none rounded-none shadow-none;
@apply bg-transparent border-none rounded-none shrink shadow-none;
}

.openapi-panel-heading {
Expand Down Expand Up @@ -579,7 +587,7 @@ body:has(.openapi-select-popover) {
}

.openapi-select > button {
@apply flex items-center font-normal cursor-pointer *:truncate gap-1.5 text-tint-strong max-w-32 rounded text-xs p-1.5 leading-none border border-tint-subtle bg-tint;
@apply flex items-center font-normal cursor-pointer *:truncate gap-1.5 text-tint-strong rounded text-xs p-1.5 leading-none border border-tint-subtle bg-tint;
@apply hover:bg-tint-hover transition-all;
}

Expand Down Expand Up @@ -613,7 +621,7 @@ body:has(.openapi-select-popover) {
}

.openapi-select-item {
@apply text-sm flex items-center cursor-pointer px-1.5 overflow-hidden py-1 *:truncate text-tint ring-0 border-none rounded !outline-none;
@apply text-sm flex items-center cursor-pointer px-1.5 overflow-hidden py-1 text-tint ring-0 border-none rounded !outline-none;
@apply hover:bg-tint-hover hover:theme-gradient:bg-tint-12/1 hover:text-tint-strong contrast-more:hover:ring-1 contrast-more:hover:ring-inset contrast-more:hover:ring-current;
}

Expand All @@ -638,6 +646,14 @@ body:has(.openapi-select-popover) {
}

/* Section Components */
.openapi-section {
@apply flex flex-col overflow-hidden;
}

.openapi-section-body {
@apply flex flex-col shrink overflow-hidden;
}

.openapi-section-header {
@apply flex flex-row items-center;
}
Expand Down