Skip to content

Commit 14e3a21

Browse files
authored
[Bug] Fix double scrollbars (#504)
* Remove redundant styles * Remove redundant styles introduced in #417 * Apply max-height to response code
1 parent 1256d1a commit 14e3a21

File tree

3 files changed

+9
-14
lines changed

3 files changed

+9
-14
lines changed

packages/docusaurus-theme-openapi-docs/src/theme/ApiDemoPanel/Curl/styles.module.css

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,3 @@
8282
background: var(--ifm-menu-color-background-active);
8383
color: var(--ifm-menu-color-active);
8484
}
85-
86-
.codeBlock code {
87-
max-width: revert;
88-
max-height: revert;
89-
}

packages/docusaurus-theme-openapi-docs/src/theme/ApiDemoPanel/Response/index.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,10 @@ function Response() {
6262
</button>
6363
</div>
6464
</summary>
65-
<CodeBlock language={response.startsWith("<") ? `xml` : `json`}>
65+
<CodeBlock
66+
language={response.startsWith("<") ? `xml` : `json`}
67+
className="openapi-demo__code-block"
68+
>
6669
{prettyResponse || "No Response"}
6770
</CodeBlock>
6871
</details>

packages/docusaurus-theme-openapi-docs/src/theme/styles.css

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -161,14 +161,6 @@
161161
margin-right: 1rem;
162162
}
163163

164-
/* Code block */
165-
166-
.theme-api-markdown code {
167-
max-width: 600px;
168-
max-height: 500px;
169-
overflow: auto;
170-
}
171-
172164
/* Version button */
173165

174166
.version-button div {
@@ -517,3 +509,8 @@
517509
div:has(> ul.openapi-tabs__security-schemes) {
518510
max-width: 100%;
519511
}
512+
513+
.openapi-demo__code-block code {
514+
max-height: 500px;
515+
overflow: auto;
516+
}

0 commit comments

Comments
 (0)