File tree Expand file tree Collapse file tree 1 file changed +40
-1
lines changed
apps/svelte.dev/src/routes/packages Expand file tree Collapse file tree 1 file changed +40
-1
lines changed Original file line number Diff line number Diff line change 9
9
}
10
10
11
11
let { title, description, packages }: Props = $props ();
12
+ const slug = $derived (` ${title .toLowerCase ().replace (/ / g , ' -' )} ` );
12
13
13
14
const INITIAL_ITEMS = 3 ;
14
15
</script >
15
16
16
17
<section class =" category" >
17
18
<header >
18
- <h2 >{title }</h2 >
19
+ <h2 id ={slug }>
20
+ <span >{title }</span >
21
+ <a href ="# {slug }" class =" permalink" aria-label =" permalink" >aa</a >
22
+ </h2 >
19
23
20
24
{#if description }
21
25
<p >{@html description }</p >
59
63
60
64
header {
61
65
margin : 0 0 2rem 0 ;
66
+ position : relative ;
62
67
63
68
h 2 {
64
69
margin : 0 0 1rem 0 ;
70
+ position : relative ;
65
71
}
66
72
67
73
p {
145
151
height : 16rem ;
146
152
min-width : 0 ; /* Prevents grid items from overflowing */
147
153
}
154
+
155
+ /* permalink */
156
+ [id ] {
157
+ scroll-margin-top : calc (var (--sk-nav-height )) !important ;
158
+ }
159
+
160
+ a .permalink {
161
+ position : absolute !important ;
162
+ display : block ;
163
+ background : var (--sk-fg-1 );
164
+ color : var (--sk-fg-1 ) !important ;
165
+ mask : url (icons/hash ) 50% 50% no-repeat ;
166
+ mask-size : 2.4rem 2.4rem ;
167
+ width : 2.6rem ;
168
+ height : 2.2rem ;
169
+ top : calc (50% - 1rem );
170
+
171
+ @media (max-width : 767px ) {
172
+ right : 0 ;
173
+ scale : 0.8 ;
174
+ }
175
+
176
+ @media (min-width : 768px ) {
177
+ left: -3rem;
178
+ opacity: 0;
179
+ transition: opacity 0.2s;
180
+
181
+ h2 :hover &,
182
+ &:focus {
183
+ opacity : 1 ;
184
+ }
185
+ }
186
+ }
148
187
</style >
You can’t perform that action at this time.
0 commit comments