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 2929 "@code-hike/smooth-code" : " ^0.3.0-next.0" ,
3030 "@code-hike/utils" : " ^0.3.0-next.0" ,
3131 "@codesandbox/sandpack-client" : " ^0.1.20" ,
32- "estree-util-value-to-estree" : " ^1.3.0" ,
3332 "hast-util-to-estree" : " ^1.4.0" ,
33+ "is-plain-obj" : " ^3.0.0" ,
3434 "node-fetch" : " ^2.0.0" ,
3535 "remark-rehype" : " ^8.1.0" ,
3636 "unified" : " ^9.2.2" ,
Original file line number Diff line number Diff line change 1010 "autoprefixer" : " ^9.8.2" ,
1111 "cssnano" : " ^4.1.10" ,
1212 "edit-json-file" : " ^1.5.0" ,
13- "node-sass" : " ^5 .0.0" ,
13+ "node-sass" : " ^6 .0.0" ,
1414 "rollup" : " ^2.41.2" ,
1515 "rollup-plugin-copy" : " ^3.3.0" ,
1616 "rollup-plugin-postcss" : " ^4.0.0" ,
Original file line number Diff line number Diff line change 99 getCodeColors ,
1010 getColor ,
1111 ColorName ,
12+ getColorScheme
1213} from "@code-hike/utils"
1314import {
1415 useStepParser ,
@@ -146,6 +147,7 @@ function AfterDimensions({
146147 opacity : 1 ,
147148 backgroundColor : bg ,
148149 color : fg ,
150+ [ "color-scheme" as any ] : getColorScheme ( theme ) ,
149151 [ "--ch-selection-background" as any ] : getColor (
150152 theme ,
151153 ColorName . SelectionBackground
Original file line number Diff line number Diff line change @@ -203,6 +203,16 @@ export function getColor(
203203 }
204204}
205205
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+
206216export function transparent (
207217 color : Color ,
208218 opacity : number
You can’t perform that action at this time.
0 commit comments