File tree 2 files changed +13
-3
lines changed
docs/src/components/ScreenShotBox
2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ const example_code = `(define re #/<h1>([^>]+)<\\/h1>/)
22
22
(loop (- i 1))))
23
23
` ;
24
24
25
- const WIDTH_MIN = 50 ;
25
+ const WIDTH_MIN = 200 ;
26
26
27
27
export default function ScreenShotBox ( ) : JSX . Element {
28
28
const dragging = useRef < boolean > ( false ) ;
@@ -48,10 +48,12 @@ export default function ScreenShotBox(): JSX.Element {
48
48
width = WIDTH_MIN + 1 ;
49
49
}
50
50
boxRef . current . style . setProperty ( '--width' , `${ width } px` ) ;
51
+ document . body . classList . add ( 'dragging' ) ;
51
52
}
52
53
}
53
54
function mouseUp ( ) {
54
55
dragging . current = false ;
56
+ document . body . classList . remove ( 'dragging' ) ;
55
57
}
56
58
document . addEventListener ( 'mousemove' , mouseMove ) ;
57
59
document . addEventListener ( 'mouseup' , mouseUp ) ;
Original file line number Diff line number Diff line change 45
45
.resizable {
46
46
display : flex;
47
47
}
48
+
49
+
48
50
.resizable .resizer {
49
51
width : 5px ;
50
52
cursor : ew-resize;
51
53
border-radius : 0 var (--radius ) var (--radius ) 0 ;
52
54
}
53
- .resizable .resizer : hover {
55
+ body .dragging : has (.resizable ) * {
56
+ cursor : ew-resize;
57
+ }
58
+ .resizable .resizer : hover , body .dragging .resizable .resizer {
54
59
background : # bd6b18 ;
55
60
}
56
61
.position , .cm-shadow-box , .wrapper {
69
74
z-index : 100 ;
70
75
overflow : hidden;
71
76
}
72
- .cm-dialog : has (+ .resizer : hover ) {
77
+ .cm-dialog : has (+ .resizer : hover ), body . dragging . cm-dialog {
73
78
border-radius : var (--radius ) 0 0 var (--radius );
74
79
}
80
+ .cm-dialog : has (+ .resizer : hover ) * , body .dragging .cm-dialog * {
81
+ user-select : none;
82
+ }
75
83
.cm-dialog header {
76
84
padding : 10px ;
77
85
}
You can’t perform that action at this time.
0 commit comments