File tree Expand file tree Collapse file tree 7 files changed +31
-9
lines changed Expand file tree Collapse file tree 7 files changed +31
-9
lines changed Original file line number Diff line number Diff line change 2
2
display : flex ;
3
3
position : relative ;
4
4
margin : 1rem 0 ;
5
+ gap : 1rem ;
5
6
}
6
7
7
8
.ch-scrollycoding-content {
8
9
box-sizing : border-box ;
9
- padding-right : 16px ;
10
10
flex : 1 ;
11
11
}
12
12
Original file line number Diff line number Diff line change @@ -11,13 +11,17 @@ export function Scrollycoding({
11
11
codeConfig,
12
12
presetConfig,
13
13
start = 0 ,
14
+ className,
15
+ style,
14
16
...rest
15
17
} : {
16
18
children : React . ReactNode
17
19
editorSteps : EditorStep [ ]
18
20
codeConfig : EditorProps [ "codeConfig" ]
19
21
start ?: number
20
22
presetConfig ?: PresetConfig
23
+ className ?: string
24
+ style ?: React . CSSProperties
21
25
} ) {
22
26
const stepsChildren = React . Children . toArray ( children )
23
27
@@ -58,7 +62,8 @@ export function Scrollycoding({
58
62
< section
59
63
className = { `ch-scrollycoding ${
60
64
presetConfig ? "ch-scrollycoding-with-preview" : ""
61
- } `}
65
+ } ${ className || "" } `}
66
+ style = { style }
62
67
>
63
68
< div className = "ch-scrollycoding-content" >
64
69
< Scroller onStepChange = { onStepChange } >
Original file line number Diff line number Diff line change @@ -16,9 +16,13 @@ const SectionContext = React.createContext<{
16
16
17
17
export function Section ( {
18
18
children,
19
+ className,
20
+ style,
19
21
...props
20
22
} : {
21
23
children : React . ReactNode
24
+ className ?: string
25
+ style ?: React . CSSProperties
22
26
} ) {
23
27
const [ state , setState ] = React . useState < any > ( props )
24
28
@@ -45,7 +49,10 @@ export function Section({
45
49
const { selectedId, ...rest } = state
46
50
47
51
return (
48
- < section >
52
+ < section
53
+ className = { `ch-section ${ className || "" } ` }
54
+ style = { style }
55
+ >
49
56
< SectionContext . Provider
50
57
value = { {
51
58
props : rest ,
Original file line number Diff line number Diff line change @@ -9,13 +9,17 @@ export function Slideshow({
9
9
codeConfig,
10
10
presetConfig,
11
11
code,
12
+ className,
13
+ style,
12
14
...rest
13
15
} : {
14
16
children : React . ReactNode
15
17
editorSteps : EditorStep [ ]
16
18
codeConfig : EditorProps [ "codeConfig" ]
17
19
presetConfig ?: PresetConfig
18
20
code ?: EditorProps [ "codeConfig" ]
21
+ className ?: string
22
+ style ?: React . CSSProperties
19
23
} ) {
20
24
const stepsChildren = React . Children . toArray ( children )
21
25
@@ -42,7 +46,8 @@ export function Slideshow({
42
46
< div
43
47
className = { `ch-slideshow ${
44
48
presetConfig ? "ch-slideshow-with-preview" : ""
45
- } `}
49
+ } ${ className || "" } `}
50
+ style = { style }
46
51
>
47
52
< div className = "ch-slideshow-slide" >
48
53
< InnerCode
Original file line number Diff line number Diff line change 1
1
.ch-spotlight {
2
2
display : flex ;
3
- gap : 0.5 rem ;
3
+ gap : 1.1 rem ;
4
4
margin : 1rem 0 ;
5
5
}
6
6
7
7
.ch-spotlight-tabs {
8
8
display : flex ;
9
9
flex-flow : column ;
10
- margin-right : 10px ;
11
10
flex : 1 ;
12
11
gap : 0.5rem ;
13
12
align-items : stretch ;
Original file line number Diff line number Diff line change @@ -9,13 +9,17 @@ export function Spotlight({
9
9
codeConfig,
10
10
start = 0 ,
11
11
presetConfig,
12
+ className,
13
+ style,
12
14
...rest
13
15
} : {
14
16
children : React . ReactNode
15
17
editorSteps : EditorStep [ ]
16
18
codeConfig : EditorProps [ "codeConfig" ]
17
19
start ?: number
18
20
presetConfig ?: PresetConfig
21
+ className ?: string
22
+ style ?: React . CSSProperties
19
23
} ) {
20
24
const stepsChildren = React . Children . toArray ( children )
21
25
@@ -38,10 +42,11 @@ export function Spotlight({
38
42
stepsChildren [ 0 ] as React . ReactElement
39
43
40
44
return (
41
- < div
45
+ < section
42
46
className = { `ch-spotlight ${
43
47
presetConfig ? "ch-spotlight-with-preview" : ""
44
- } `}
48
+ } ${ className || "" } `}
49
+ style = { style }
45
50
>
46
51
< div className = "ch-spotlight-tabs" >
47
52
{ headerElement ?. props ?. children ? (
@@ -83,6 +88,6 @@ export function Spotlight({
83
88
/>
84
89
) }
85
90
</ div >
86
- </ div >
91
+ </ section >
87
92
)
88
93
}
Original file line number Diff line number Diff line change @@ -48,6 +48,7 @@ async function transformSection(
48
48
name : "CH.Section" ,
49
49
props : props as any ,
50
50
addConfigProp : true ,
51
+ appendProps : true ,
51
52
} )
52
53
} else {
53
54
toJSX ( node , { name : "div" , props : { } } )
You can’t perform that action at this time.
0 commit comments