File tree Expand file tree Collapse file tree 3 files changed +26
-1
lines changed Expand file tree Collapse file tree 3 files changed +26
-1
lines changed Original file line number Diff line number Diff line change 77 map ,
88 FocusString ,
99 getCodeColors ,
10+ getColor ,
11+ ColorName ,
1012} from "@code-hike/utils"
1113import {
1214 useStepParser ,
@@ -140,7 +142,15 @@ function AfterDimensions({
140142 return (
141143 < Wrapper
142144 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+ } }
144154 >
145155 < SmoothLines
146156 codeStep = { stepInfo }
Original file line number Diff line number Diff line change 1414 line-height : 19px ;
1515 letter-spacing : 0px ;
1616}
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 {
4242 InputForeground ,
4343 InputBackground ,
4444 InputBorder ,
45+ SelectionBackground ,
4546}
4647
4748type Color = string | undefined
@@ -188,6 +189,15 @@ export function getColor(
188189 hc : contrastBorder ,
189190 } )
190191 )
192+ case ColorName . SelectionBackground :
193+ return (
194+ colors [ "editor.selectionBackground" ] ||
195+ getDefault ( theme , {
196+ light : "#ADD6FF" ,
197+ dark : "#264F78" ,
198+ hc : "#f3f518" ,
199+ } )
200+ )
191201 default :
192202 return "#f00"
193203 }
You can’t perform that action at this time.
0 commit comments