Commit 85ecbb2
committed
Make anchor underlines react better to clicks
This ensures that the anchor that is clicked is always the one that gets
underlined, even if just scrolling to that heading would underline a
different anchor.
Using `onhashchange` alone instead of adding `onclick`s to each anchor
is not sufficient because it's possible to click on an anchor that
already has its hash in the URL but has been scrolled away from.1 parent 722be43 commit 85ecbb2
File tree
1 file changed
+21
-10
lines changed- apps/svelte.dev/src/routes/docs/[topic]/[...path]
1 file changed
+21
-10
lines changedLines changed: 21 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | | - | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
14 | 18 | | |
15 | 19 | | |
16 | | - | |
17 | | - | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
18 | 30 | | |
19 | | - | |
20 | 31 | | |
21 | 32 | | |
22 | 33 | | |
| |||
28 | 39 | | |
29 | 40 | | |
30 | 41 | | |
31 | | - | |
32 | 42 | | |
33 | 43 | | |
34 | 44 | | |
35 | 45 | | |
36 | 46 | | |
37 | | - | |
| 47 | + | |
38 | 48 | | |
39 | 49 | | |
40 | 50 | | |
41 | 51 | | |
42 | 52 | | |
43 | | - | |
| 53 | + | |
44 | 54 | | |
45 | 55 | | |
46 | 56 | | |
| |||
51 | 61 | | |
52 | 62 | | |
53 | 63 | | |
54 | | - | |
| 64 | + | |
55 | 65 | | |
56 | 66 | | |
57 | 67 | | |
58 | 68 | | |
59 | 69 | | |
60 | 70 | | |
61 | | - | |
| 71 | + | |
| 72 | + | |
62 | 73 | | |
63 | 74 | | |
64 | 75 | | |
| |||
0 commit comments