File tree 3 files changed +26
-1
lines changed
3 files changed +26
-1
lines changed Original file line number Diff line number Diff line change 7
7
map ,
8
8
FocusString ,
9
9
getCodeColors ,
10
+ getColor ,
11
+ ColorName ,
10
12
} from "@code-hike/utils"
11
13
import {
12
14
useStepParser ,
@@ -140,7 +142,15 @@ function AfterDimensions({
140
142
return (
141
143
< Wrapper
142
144
htmlProps = { htmlProps }
143
- style = { { opacity : 1 , backgroundColor : bg , color : fg } }
145
+ style = { {
146
+ opacity : 1 ,
147
+ backgroundColor : bg ,
148
+ color : fg ,
149
+ [ "--ch-selection-background" as any ] : getColor (
150
+ theme ,
151
+ ColorName . SelectionBackground
152
+ ) ,
153
+ } }
144
154
>
145
155
< SmoothLines
146
156
codeStep = { stepInfo }
Original file line number Diff line number Diff line change 14
14
line-height : 19px ;
15
15
letter-spacing : 0px ;
16
16
}
17
+
18
+ .ch-code-scroll-parent ::selection {
19
+ background-color : var (--ch-selection-background );
20
+ color : inherit ;
21
+ }
Original file line number Diff line number Diff line change @@ -42,6 +42,7 @@ export enum ColorName {
42
42
InputForeground ,
43
43
InputBackground ,
44
44
InputBorder ,
45
+ SelectionBackground ,
45
46
}
46
47
47
48
type Color = string | undefined
@@ -188,6 +189,15 @@ export function getColor(
188
189
hc : contrastBorder ,
189
190
} )
190
191
)
192
+ case ColorName . SelectionBackground :
193
+ return (
194
+ colors [ "editor.selectionBackground" ] ||
195
+ getDefault ( theme , {
196
+ light : "#ADD6FF" ,
197
+ dark : "#264F78" ,
198
+ hc : "#f3f518" ,
199
+ } )
200
+ )
191
201
default :
192
202
return "#f00"
193
203
}
You can’t perform that action at this time.
0 commit comments