File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Expand file tree Collapse file tree 2 files changed +12
-0
lines changed 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