Skip to content

Commit b9ffd27

Browse files
committed
fix: improve handling of horizontal scroll on small screens
1 parent 5b2b445 commit b9ffd27

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

packages/rehype-shiki/src/transformers/twoslash/index.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@
66
}
77

88
.twoslash-popup-code {
9-
max-width: 600px;
9+
max-width: min(600px, 90vw);
1010
display: block;
1111
width: fit-content;
1212
user-select: none;
13+
overflow-wrap: break-word;
1314
}
1415

1516
.twoslash-popup-code:not(:has(div)) {

packages/ui-components/src/Common/BaseCodeBox/index.module.css

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
.root {
44
@apply w-full
55
max-w-full
6-
overflow-x-clip
6+
overflow-x-hidden
77
rounded-sm
88
border
99
border-neutral-900
@@ -20,6 +20,7 @@
2020
scrollbar-thin
2121
grid
2222
max-w-full
23+
[grid-template-columns:minmax(0,1fr)]
2324
overflow-x-auto
2425
bg-transparent
2526
p-0
@@ -31,7 +32,8 @@
3132
& > [class='line'] {
3233
@apply relative
3334
min-w-0
34-
pl-8;
35+
pl-8
36+
[overflow-wrap:anywhere];
3537

3638
&:not(:empty:last-child)::before {
3739
@apply inline-block

0 commit comments

Comments
 (0)