Skip to content

Commit 4d07693

Browse files
committed
fix(style): removing codeblock bottom padding if last child is a highlight block
1 parent c0074d6 commit 4d07693

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/components/codeBlock/code-blocks.module.scss

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@
5757
min-width: 100%;
5858
}
5959

60+
:global(.code-highlight > .highlight-block:last-child) {
61+
margin-bottom: -10px;
62+
}
63+
6064
:global(.code-line) {
6165
display: block;
6266
float: left;
@@ -74,7 +78,6 @@
7478
}
7579
}
7680

77-
7881
/* Diff highlighting, classes provided by rehype-prism-plus */
7982
/* Set inserted line (+) color */
8083
/* Move the margin left and adjust width so we can keep the parent padding */

src/components/codeHighlights/codeHighlights.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ export function HighlightBlock({
109109
}
110110

111111
return (
112-
<HighlightBlockContainer>
112+
<HighlightBlockContainer className="highlight-block">
113113
<CodeLinesContainer ref={codeRef}>{children}</CodeLinesContainer>
114114
<ClipBoardContainer onClick={copyCodeOnClick}>
115115
{showCopyButton && !copied && (

0 commit comments

Comments
 (0)