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 55}
66
77.ch-scrollycoding-content {
8- width : 50% ;
98 box-sizing : border-box ;
109 padding-right : 16px ;
10+ flex : 1 ;
1111}
1212
1313.ch-scrollycoding-step-content {
3939 align-self : start ;
4040 flex-flow : column ;
4141 justify-content : center ;
42- width : 420px ;
42+ width : var ( --ch-scrollycoding-sticker-width , 420px ) ;
4343 // capitalized Min to avoid usint the sass min
4444 // min-height: Min(100%, 80vh);
4545 max-height : 80vh ;
6666 .ch-codegroup {
6767 width : 100% ;
6868 min-width : 100% ;
69- min-height : 200px ;
69+ min-height : var (
70+ --ch-scrollycoding-code-min-height ,
71+ 200px
72+ );
7073 max-height : 80vh ;
7174 margin-top : 0 ;
7275 margin-bottom : 0 ;
Original file line number Diff line number Diff line change 1515
1616 & > * {
1717 height : 100% ;
18+ max-height : inherit ;
19+ min-height : inherit ;
1820 }
1921}
2022
Original file line number Diff line number Diff line change @@ -57,8 +57,6 @@ export const EditorFrame = React.forwardRef<
5757 } ,
5858 ref
5959) {
60- const c = useClasser ( "ch-editor" )
61-
6260 return (
6361 < div
6462 ref = { ref }
Original file line number Diff line number Diff line change 66import { TerminalPanel } from "./terminal-panel"
77import { useTransition , EditorStep } from "./editor-shift"
88import { CodeConfig } from "@code-hike/smooth-code"
9+ import { useLayoutEffect } from "@code-hike/utils"
910
1011export {
1112 EditorTransition ,
@@ -14,11 +15,6 @@ export {
1415 EditorTweenProps ,
1516}
1617
17- const useLayoutEffect =
18- typeof window !== "undefined"
19- ? React . useLayoutEffect
20- : React . useEffect
21-
2218type EditorTransitionProps = {
2319 prev ?: EditorStep
2420 next ?: EditorStep
Original file line number Diff line number Diff line change @@ -10,6 +10,8 @@ div#__next > div {
1010 flex-direction : column;
1111 font-family : sans-serif;
1212 background-color : # 444 ;
13+ /* --ch-scrollycoding-code-min-height: 500px;
14+ --ch-scrollycoding-sticker-width: 500px; */
1315}
1416
1517nav {
Original file line number Diff line number Diff line change 33 FocusString ,
44 getFocusIndexes ,
55 Tween ,
6+ useLayoutEffect ,
67} from "@code-hike/utils"
78
89type Dimensions = {
@@ -16,11 +17,6 @@ type Dimensions = {
1617 lineNumberWidth : number
1718} | null
1819
19- const useLayoutEffect =
20- typeof window !== "undefined"
21- ? React . useLayoutEffect
22- : React . useEffect
23-
2420export { useDimensions , Dimensions }
2521
2622const 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"
22export * from "./code"
33export * from "./focus"
44export * from "./theme"
5+ export * from "./hooks"
You can’t perform that action at this time.
0 commit comments