File tree Expand file tree Collapse file tree 6 files changed +65
-19
lines changed Expand file tree Collapse file tree 6 files changed +65
-19
lines changed Original file line number Diff line number Diff line change 6
6
box-shadow : inset 0 1px var (--colorBlack200 );
7
7
}
8
8
9
+ .refItem-name {
10
+ position : relative;
11
+ display : flex;
12
+ align-items : center;
13
+ gap : 0.5rem ;
14
+ color : inherit
15
+ }
16
+
9
17
.refItem-name code {
10
18
font-weight : 600 ;
11
19
overflow-y : auto;
27
35
font-weight : 400 ;
28
36
}
29
37
38
+ .refItem-anchor-icon {
39
+ opacity : 0 ;
40
+ color : var (--colorBlack600 );
41
+ text-decoration : none;
42
+ transition : opacity 0.1s ease;
43
+ }
44
+
45
+ .refItem-name : hover .refItem-anchor-icon {
46
+ opacity : 1 ;
47
+ }
48
+
49
+ .refItem-anchor-icon : hover {
50
+ color : var (--colorBlack800 );
51
+ }
52
+
53
+ .refItem-anchor-icon {
54
+ width : 1em ;
55
+ height : 1em ;
56
+ }
57
+
30
58
.refItem-details {
31
59
display : flex;
32
60
}
Original file line number Diff line number Diff line change 1
- /* Background */ .bg { background-color : var (--colorBlack200 ) ; }
2
- /* PreWrapper */ .chroma { background-color : var (--colorBlack200 ); font-size : 1.4rem ; }
1
+ /* Background */ .bg { background-color : var (--colorBlack100 ); border-radius : 0.2 em ; }
2
+ /* PreWrapper */ .chroma { background-color : var (--colorBlack100 ); font-size : 1.4rem ; border-radius : 0.2 em ; }
3
3
/* Other */ .chroma .x { }
4
4
/* Error */ .chroma .err { color : var (--colorError ); }
5
5
/* CodeLine */ .chroma .cl { }
72
72
/* CommentPreproc */ .chroma .cp { color : # 67707b ; font-style : italic }
73
73
/* CommentPreprocFile */ .chroma .cpf { color : # 67707b ; font-style : italic }
74
74
/* Generic */ .chroma .g { }
75
- /* GenericDeleted */ .chroma .gd { }
75
+ /* GenericDeleted */ .chroma .gd { background-color : rgb ( 255 , 206 , 203 ); }
76
76
/* GenericEmph */ .chroma .ge { }
77
77
/* GenericError */ .chroma .gr { }
78
78
/* GenericHeading */ .chroma .gh { }
79
- /* GenericInserted */ .chroma .gi { }
79
+ /* GenericInserted */ .chroma .gi { background-color : rgb ( 172 , 238 , 187 ); }
80
80
/* GenericOutput */ .chroma .go { }
81
81
/* GenericPrompt */ .chroma .gp { }
82
82
/* GenericStrong */ .chroma .gs { }
Original file line number Diff line number Diff line change @@ -120,17 +120,26 @@ h6,
120
120
line-height : 1.25 ;
121
121
}
122
122
123
+ .title-link {
124
+ color : inherit;
125
+ text-decoration : none;
126
+ }
127
+
128
+ .title-link : hover {
129
+ color : inherit;
130
+ }
131
+
123
132
.title-anchor {
124
- color : var (--colorBlack400 );
125
133
font-size : 0.8em ;
126
134
font-weight : normal;
127
- display : none;
135
+ opacity : 0 ;
136
+ transition : opacity 0.1s ease;
128
137
}
129
138
130
139
h2 , h3 , h4 , h5 , h6 {
131
- & : hover {
132
- a .title-anchor {
133
- display : inline ;
140
+ . title-link : hover {
141
+ .title-anchor {
142
+ opacity : 1 ;
134
143
}
135
144
}
136
145
}
Original file line number Diff line number Diff line change 1
1
import {
2
2
ChevronDown ,
3
3
X ,
4
-
4
+ Link ,
5
5
createIcons ,
6
6
} from 'lucide' ;
7
7
8
8
createIcons ( {
9
9
icons : {
10
10
X,
11
11
ChevronDown,
12
+ Link,
12
13
} ,
13
14
attrs : { 'aria-hidden' : true } ,
14
15
} ) ;
Original file line number Diff line number Diff line change 1
1
< h {{ .Level }} id ="{{ .Anchor }} ">
2
+ {{ if ne .Level 1 }}
3
+ < a class ="title-link " href ="#{{ .Anchor }} ">
4
+ {{ end }}
2
5
{{ .Text | safeHTML }}
3
6
{{ if ne .Level 1 }}
4
- < a class ="title-anchor " href ="#{{ .Anchor }} "> 🔗</ a >
7
+ < i class ="title-anchor icon " data-lucide ="link "> </ i >
8
+ </ a >
5
9
{{ end }}
10
+
11
+
6
12
</ h {{ .Level }}>
Original file line number Diff line number Diff line change 7
7
{{/* Get description either from attribute or nested content */}}
8
8
{{ $description := .Get "description" }}
9
9
{{ $example := .Get "example" }}
10
+ {{ $anchorID := $name | lower | replaceRE "[^a-z0-9-]" "-" | replaceRE "-+" "-" | replaceRE "^-" "" | replaceRE "-$" "" }}
10
11
11
- < div class ="refItem ">
12
- < div class ="refItem-name ">
13
- < code > {{ $name }}</ code >
14
- < span class ="refItem-type "> {{ $type }}</ span >
15
- {{ with $required }}
16
- < span class ="refItem-required "> {{ if eq . true }}required{{ else }}{{ . | markdownify }}{{ end }}</ span >
17
- {{ end }}
18
- </ div >
12
+ < div class ="refItem " id ="ref-{{ $anchorID }} ">
13
+ < a href ="#ref-{{ $anchorID }} " class ="refItem-name ">
14
+ < code > {{ $name }}</ code >
15
+ < span class ="refItem-type "> {{ $type }}</ span >
16
+ {{ with $required }}
17
+ < span class ="refItem-required "> {{ if eq . true }}required{{ else }}{{ . | markdownify }}{{ end }}</ span >
18
+ {{ end }}
19
+ < i class ="refItem-anchor-icon icon " data-lucide ="link "> </ i >
20
+ </ a >
19
21
< div class ="refItem-description "> {{ $description | markdownify | safeHTML }}</ div >
20
22
< div class ="refItem-details refItem-details__{{ if .Inner }}full{{ end }} ">
21
23
{{ if $default }}
You can’t perform that action at this time.
0 commit comments