File tree Expand file tree Collapse file tree 5 files changed +51
-303
lines changed Expand file tree Collapse file tree 5 files changed +51
-303
lines changed Original file line number Diff line number Diff line change 29
29
"@code-hike/smooth-code" : " ^0.3.0-next.0" ,
30
30
"@code-hike/utils" : " ^0.3.0-next.0" ,
31
31
"@codesandbox/sandpack-client" : " ^0.1.20" ,
32
- "estree-util-value-to-estree" : " ^1.3.0" ,
33
32
"hast-util-to-estree" : " ^1.4.0" ,
33
+ "is-plain-obj" : " ^3.0.0" ,
34
34
"node-fetch" : " ^2.0.0" ,
35
35
"remark-rehype" : " ^8.1.0" ,
36
36
"unified" : " ^9.2.2" ,
Original file line number Diff line number Diff line change 10
10
"autoprefixer" : " ^9.8.2" ,
11
11
"cssnano" : " ^4.1.10" ,
12
12
"edit-json-file" : " ^1.5.0" ,
13
- "node-sass" : " ^5 .0.0" ,
13
+ "node-sass" : " ^6 .0.0" ,
14
14
"rollup" : " ^2.41.2" ,
15
15
"rollup-plugin-copy" : " ^3.3.0" ,
16
16
"rollup-plugin-postcss" : " ^4.0.0" ,
Original file line number Diff line number Diff line change 9
9
getCodeColors ,
10
10
getColor ,
11
11
ColorName ,
12
+ getColorScheme
12
13
} from "@code-hike/utils"
13
14
import {
14
15
useStepParser ,
@@ -146,6 +147,7 @@ function AfterDimensions({
146
147
opacity : 1 ,
147
148
backgroundColor : bg ,
148
149
color : fg ,
150
+ [ "color-scheme" as any ] : getColorScheme ( theme ) ,
149
151
[ "--ch-selection-background" as any ] : getColor (
150
152
theme ,
151
153
ColorName . SelectionBackground
Original file line number Diff line number Diff line change @@ -203,6 +203,16 @@ export function getColor(
203
203
}
204
204
}
205
205
206
+ export function getColorScheme ( theme : EditorTheme ) : string | undefined {
207
+ const themeType = getThemeType ( theme )
208
+ if ( themeType === "dark" ) {
209
+ return "dark"
210
+ } else if ( themeType === "light" ) {
211
+ return "light"
212
+ }
213
+ return undefined
214
+ }
215
+
206
216
export function transparent (
207
217
color : Color ,
208
218
opacity : number
You can’t perform that action at this time.
0 commit comments