File tree Expand file tree Collapse file tree 3 files changed +17
-22
lines changed Expand file tree Collapse file tree 3 files changed +17
-22
lines changed Original file line number Diff line number Diff line change 107
107
.ch-code-box-annotation {
108
108
outline : 2px solid var (--ch-l-editor-infoForeground );
109
109
}
110
+
111
+ .ch-code-label-annotation :hover {
112
+ background : var (--ch-l-editor-lineHighlightBackground );
113
+ .ch-code-label-annotation-text {
114
+ display : block ;
115
+ }
116
+ }
117
+ .ch-code-label-annotation-text {
118
+ position : absolute ;
119
+ right : 0 ;
120
+ padding-right : 16px ;
121
+ opacity : 0.7 ;
122
+ display : none ;
123
+ }
Original file line number Diff line number Diff line change 6
6
LineWithElement ,
7
7
} from "../smooth-code/partial-step-parser"
8
8
import { CopyButton } from "../smooth-code/copy-button"
9
- import { CSSV } from "utils/light/css"
10
9
11
10
export function Annotation ( ) {
12
11
return (
@@ -140,28 +139,10 @@ function WithClass({
140
139
}
141
140
142
141
function Label ( { children, data, style } : AnnotationProps ) {
143
- const bg = CSSV . editor . lineHighlightBackground
144
- const [ hover , setHover ] = React . useState ( false )
145
-
146
142
return (
147
- < div
148
- style = { {
149
- ...style ,
150
- background : hover ? bg : undefined ,
151
- } }
152
- onMouseEnter = { ( ) => setHover ( true ) }
153
- onMouseLeave = { ( ) => setHover ( false ) }
154
- >
143
+ < div className = "ch-code-label-annotation" style = { style } >
155
144
{ children }
156
- < div
157
- style = { {
158
- position : "absolute" ,
159
- right : 0 ,
160
- paddingRight : 16 ,
161
- display : hover ? "block" : "none" ,
162
- opacity : 0.7 ,
163
- } }
164
- >
145
+ < div className = "ch-code-label-annotation-text" >
165
146
{ data ?. children || data }
166
147
</ div >
167
148
</ div >
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ function vn(key: string) {
43
43
return `--ch-l-${ key . replace ( "." , "-" ) } `
44
44
}
45
45
46
- export const CSSV = {
46
+ const CSSV = {
47
47
colorScheme : v ( "colorScheme" ) ,
48
48
foreground : v ( "foreground" ) ,
49
49
background : v ( "background" ) ,
You can’t perform that action at this time.
0 commit comments