Skip to content

Commit c0836c7

Browse files
authoredAug 13, 2022
Merge pull request #267 from code-hike/border-box-scrollbars
Force content box in code-wrapper
2 parents e097ce2 + 6ac2b96 commit c0836c7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed
 

‎packages/mdx/src/smooth-code/code-tween.tsx

+3
Original file line numberDiff line numberDiff line change
@@ -192,13 +192,16 @@ function Wrapper({
192192
}) {
193193
return (
194194
<div
195+
className="ch-code-wrapper"
195196
{...htmlProps}
196197
style={{
197198
margin: 0,
198199
padding: 0,
199200
position: "relative",
200201
// using this instead of <pre> because https://github.com/code-hike/codehike/issues/120
201202
whiteSpace: "pre",
203+
// to avoid resets using "border-box" that break the scrollbar https://github.com/code-hike/codehike/issues/240
204+
boxSizing: "content-box",
202205
...style,
203206
...htmlProps?.style,
204207
}}

0 commit comments

Comments
 (0)