File tree Expand file tree Collapse file tree 8 files changed +25
-15
lines changed Expand file tree Collapse file tree 8 files changed +25
-15
lines changed Original file line number Diff line number Diff line change 5
5
}
6
6
7
7
.ch-scrollycoding-content {
8
- width : 50% ;
9
8
box-sizing : border-box ;
10
9
padding-right : 16px ;
10
+ flex : 1 ;
11
11
}
12
12
13
13
.ch-scrollycoding-step-content {
39
39
align-self : start ;
40
40
flex-flow : column ;
41
41
justify-content : center ;
42
- width : 420px ;
42
+ width : var ( --ch-scrollycoding-sticker-width , 420px ) ;
43
43
// capitalized Min to avoid usint the sass min
44
44
// min-height: Min(100%, 80vh);
45
45
max-height : 80vh ;
66
66
.ch-codegroup {
67
67
width : 100% ;
68
68
min-width : 100% ;
69
- min-height : 200px ;
69
+ min-height : var (
70
+ --ch-scrollycoding-code-min-height ,
71
+ 200px
72
+ );
70
73
max-height : 80vh ;
71
74
margin-top : 0 ;
72
75
margin-bottom : 0 ;
Original file line number Diff line number Diff line change 15
15
16
16
& > * {
17
17
height : 100% ;
18
+ max-height : inherit ;
19
+ min-height : inherit ;
18
20
}
19
21
}
20
22
Original file line number Diff line number Diff line change @@ -57,8 +57,6 @@ export const EditorFrame = React.forwardRef<
57
57
} ,
58
58
ref
59
59
) {
60
- const c = useClasser ( "ch-editor" )
61
-
62
60
return (
63
61
< div
64
62
ref = { ref }
Original file line number Diff line number Diff line change 6
6
import { TerminalPanel } from "./terminal-panel"
7
7
import { useTransition , EditorStep } from "./editor-shift"
8
8
import { CodeConfig } from "@code-hike/smooth-code"
9
+ import { useLayoutEffect } from "@code-hike/utils"
9
10
10
11
export {
11
12
EditorTransition ,
@@ -14,11 +15,6 @@ export {
14
15
EditorTweenProps ,
15
16
}
16
17
17
- const useLayoutEffect =
18
- typeof window !== "undefined"
19
- ? React . useLayoutEffect
20
- : React . useEffect
21
-
22
18
type EditorTransitionProps = {
23
19
prev ?: EditorStep
24
20
next ?: EditorStep
Original file line number Diff line number Diff line change @@ -10,6 +10,8 @@ div#__next > div {
10
10
flex-direction : column;
11
11
font-family : sans-serif;
12
12
background-color : # 444 ;
13
+ /* --ch-scrollycoding-code-min-height: 500px;
14
+ --ch-scrollycoding-sticker-width: 500px; */
13
15
}
14
16
15
17
nav {
Original file line number Diff line number Diff line change 3
3
FocusString ,
4
4
getFocusIndexes ,
5
5
Tween ,
6
+ useLayoutEffect ,
6
7
} from "@code-hike/utils"
7
8
8
9
type Dimensions = {
@@ -16,11 +17,6 @@ type Dimensions = {
16
17
lineNumberWidth : number
17
18
} | null
18
19
19
- const useLayoutEffect =
20
- typeof window !== "undefined"
21
- ? React . useLayoutEffect
22
- : React . useEffect
23
-
24
20
export { useDimensions , Dimensions }
25
21
26
22
const DEFAULT_WIDTH = 200
Original file line number Diff line number Diff line change
1
+ import React from "react"
2
+
3
+ export const useLayoutEffect =
4
+ typeof window !== "undefined"
5
+ ? React . useLayoutEffect
6
+ : React . useEffect
7
+
8
+ // for debugging:
9
+ // export const useLayoutEffect = (
10
+ // effect: any,
11
+ // deps?: any
12
+ // ) => {}
Original file line number Diff line number Diff line change @@ -2,3 +2,4 @@ export * from "./tween"
2
2
export * from "./code"
3
3
export * from "./focus"
4
4
export * from "./theme"
5
+ export * from "./hooks"
You can’t perform that action at this time.
0 commit comments