File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 107107.ch-code-box-annotation {
108108 outline : 2px solid var (--ch-l-editor-infoForeground );
109109}
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 66 LineWithElement ,
77} from "../smooth-code/partial-step-parser"
88import { CopyButton } from "../smooth-code/copy-button"
9- import { CSSV } from "utils/light/css"
109
1110export function Annotation ( ) {
1211 return (
@@ -140,28 +139,10 @@ function WithClass({
140139}
141140
142141function Label ( { children, data, style } : AnnotationProps ) {
143- const bg = CSSV . editor . lineHighlightBackground
144- const [ hover , setHover ] = React . useState ( false )
145-
146142 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 } >
155144 { 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" >
165146 { data ?. children || data }
166147 </ div >
167148 </ div >
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ function vn(key: string) {
4343 return `--ch-l-${ key . replace ( "." , "-" ) } `
4444}
4545
46- export const CSSV = {
46+ const CSSV = {
4747 colorScheme : v ( "colorScheme" ) ,
4848 foreground : v ( "foreground" ) ,
4949 background : v ( "background" ) ,
You can’t perform that action at this time.
0 commit comments