Skip to content

Commit c26936f

Browse files
authored
fixing styling on code blocks for rest pages (github#26237)
1 parent e8d0acc commit c26936f

File tree

2 files changed

+4
-14
lines changed

2 files changed

+4
-14
lines changed

components/rest/CodeBlock.module.scss

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
.codeBlock {
2-
pre {
3-
margin-bottom: 0;
4-
border: 1px solid var(--color-border-default);
5-
max-height: 32rem;
6-
overflow: auto;
7-
}
2+
max-height: 32rem;
3+
overflow: auto;
84
}

components/rest/CodeBlock.tsx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export function CodeBlock({ verb, headingLang, codeBlock, highlight }: Props) {
2020
})
2121

2222
return (
23-
<div className="code-extra">
23+
<div className={headingLang && 'code-extra'}>
2424
{headingLang && (
2525
<header className="d-flex flex-justify-between flex-items-center p-2 text-small rounded-top-1 border">
2626
{headingLang === 'JavaScript' ? (
@@ -41,13 +41,7 @@ export function CodeBlock({ verb, headingLang, codeBlock, highlight }: Props) {
4141
</Tooltip>
4242
</header>
4343
)}
44-
<pre
45-
className={cx(
46-
styles.methodCodeBlock,
47-
'd-flex flex-justify-between flex-items-center rounded-1 border'
48-
)}
49-
data-highlight={highlight}
50-
>
44+
<pre className={cx(styles.codeBlock, 'rounded-1 border')} data-highlight={highlight}>
5145
<code>
5246
{verb && (
5347
<span className="color-bg-accent-emphasis color-fg-on-emphasis rounded-1 text-uppercase p-1">

0 commit comments

Comments
 (0)