File tree Expand file tree Collapse file tree 3 files changed +22
-9
lines changed Expand file tree Collapse file tree 3 files changed +22
-9
lines changed Original file line number Diff line number Diff line change @@ -19,11 +19,14 @@ $info = #1C90F3
19
19
20
20
$radius = 2px
21
21
$content-padding-top = 30px
22
+
23
+ // header settings
22
24
$header-inner-height = 41px
23
25
$heading-padding-vertical = 10px
24
26
$header-height = $header-inner-height + $heading-padding-vertical * 2
25
27
$mobile-header-height = 40px
26
- $heading-link-padding-top = $content-padding-top
27
- $mobile-heading-link-padding-top = $content-padding-top
28
+ // prevent headers from being covered by the top nav upon navigation
29
+ $heading-link-padding-top = $header-height + $content-padding-top
30
+ $mobile-heading-link-padding-top = $mobile-header-height + $content-padding-top
28
31
$h2-margin-top = 45px
29
32
$h3-margin-top = 52px
Original file line number Diff line number Diff line change 51
51
h1
52
52
margin : 0 0 1em
53
53
h2 , h3
54
+ pointer-events : none
55
+ a
56
+ pointer-events : auto
57
+ color : $dark
54
58
& :before
55
59
content : ""
56
60
display : block
61
65
margin : $h2-margin-top 0 .8em
62
66
padding-bottom : .7em
63
67
border-bottom : 1px solid $border
64
- z-index : - 1
65
68
h3
66
69
margin : $h3-margin-top 0 1.2em
67
70
position : relative
68
- z-index : - 1
69
71
& :after
70
72
content : "#"
71
73
color : $green
Original file line number Diff line number Diff line change 1
1
( function ( ) {
2
-
3
2
initMobileMenu ( )
4
3
if ( PAGE_TYPE ) {
5
4
initVersionSelect ( )
26
25
} )
27
26
}
28
27
29
- function createSourceSearchPath ( query ) {
28
+ function createSourceSearchPath ( query ) {
30
29
query = query
31
30
. replace ( / \( [ ^ \) ] * ?\) / g, '' )
32
31
. replace ( / ( V u e \. ) ( \w + ) / g, '$1$2" OR "$2' )
251
250
}
252
251
}
253
252
if ( last )
254
- setActive ( last . id , ! hoveredOverSidebar )
253
+ setActive ( last . id , ! hoveredOverSidebar )
255
254
}
256
255
257
256
function makeLink ( h ) {
337
336
function makeHeaderClickable ( link ) {
338
337
var wrapper = link . querySelector ( 'a' )
339
338
wrapper . setAttribute ( 'data-scroll' , '' )
340
- link . parentNode . insertBefore ( wrapper , link )
341
- wrapper . appendChild ( link )
339
+
340
+ // transform DOM structure from
341
+ // `<h2><a></a>Header</a>` to <h2><a>Header</a></h2>`
342
+ // to make the link clickable
343
+ var nodes = link . childNodes
344
+ for ( var i = 0 ; i < nodes . length ; i ++ ) {
345
+ var node = nodes [ i ]
346
+ if ( node !== wrapper ) {
347
+ wrapper . appendChild ( node )
348
+ }
349
+ }
342
350
}
343
351
}
344
352
} ) ( )
You can’t perform that action at this time.
0 commit comments