| 1 |
.vector-toc { |
| 2 |
.vector-pinnable-header { |
| 3 |
margin-left: @toc-list-item-padding-start; |
| 4 |
} |
| 5 |
|
| 6 |
.vector-pinnable-header-label { |
| 7 |
font-size: @font-size-reset; // Update font-size because the label is an <h2> |
| 8 |
} |
| 9 |
|
| 10 |
.vector-toc-numb { |
| 11 |
display: none; |
| 12 |
} |
| 13 |
|
| 14 |
.vector-toc-toggle { |
| 15 |
// For no-js users, toggling is disabled and icon is hidden |
| 16 |
display: none; |
| 17 |
transition: @transition-duration-base; |
| 18 |
position: absolute; |
| 19 |
left: -@size-toc-subsection-toggle/2; |
| 20 |
// Visual centering. |
| 21 |
top: 1px; |
| 22 |
// Override .cdx-button styles |
| 23 |
min-width: @size-toc-subsection-toggle; // ~22px @ 12 |
| 24 |
min-height: @size-toc-subsection-toggle; |
| 25 |
padding: 0; |
| 26 |
font-size: @size-toc-subsection-toggle-icon; |
| 27 |
} |
| 28 |
|
| 29 |
.vector-toc-link { |
| 30 |
display: block; |
| 31 |
word-break: break-word; |
| 32 |
} |
| 33 |
|
| 34 |
// Highlight and bold active sections, active top sections that are unexpanded |
| 35 |
// and active top sections that are the only active element. |
| 36 |
.vector-toc-list-item-active, |
| 37 |
.vector-toc-level-1-active:not( .vector-toc-list-item-expanded ), |
| 38 |
.vector-toc-list-item-active.vector-toc-level-1-active { |
| 39 |
> .vector-toc-link { |
| 40 |
// Highlight active section |
| 41 |
.mixin-vector-selected-link(); |
| 42 |
font-weight: bold; |
| 43 |
|
| 44 |
.vector-toc-text { |
| 45 |
// Increase width to prevent line wrapping due to bold text |
| 46 |
// Avoid applying on link element to avoid focus indicator changing size |
| 47 |
width: ~'calc( 100% + @{padding-horizontal-dropdown-menu} )'; |
| 48 |
} |
| 49 |
} |
| 50 |
} |
| 51 |
|
| 52 |
// Highlight active top sections that contain an active section |
| 53 |
.vector-toc-level-1-active:not( .vector-toc-list-item-active ) > .vector-toc-link { |
| 54 |
.mixin-vector-selected-link(); |
| 55 |
} |
| 56 |
|
| 57 |
.vector-toc-text { |
| 58 |
// Match .mixin-vector-dropdown-menu-item() vertical padding |
| 59 |
padding: @padding-vertical-dropdown-menu-item 0; |
| 60 |
} |
| 61 |
|
| 62 |
.vector-toc-contents, |
| 63 |
.vector-toc-list { |
| 64 |
margin: 0; |
| 65 |
list-style: none; |
| 66 |
} |
| 67 |
|
| 68 |
.vector-toc-list-item { |
| 69 |
position: relative; |
| 70 |
list-style-type: none; |
| 71 |
padding-left: @toc-list-item-padding-start; |
| 72 |
margin: 0; |
| 73 |
} |
| 74 |
} |
| 75 |
|
| 76 |
// Collapse ToC sections by default, excluding no-js |
| 77 |
.client-js .vector-toc { |
| 78 |
.vector-toc-level-1 .vector-toc-list-item { |
| 79 |
display: none; |
| 80 |
} |
| 81 |
|
| 82 |
.vector-toc-level-1.vector-toc-list-item-expanded .vector-toc-list-item { |
| 83 |
display: block; |
| 84 |
} |
| 85 |
|
| 86 |
.vector-toc-toggle { |
| 87 |
display: block; |
| 88 |
} |
| 89 |
|
| 90 |
.vector-toc-level-1.vector-toc-list-item-expanded .vector-toc-toggle { |
| 91 |
transform: rotate( 0deg ); |
| 92 |
} |
| 93 |
} |
| 94 |
|
| 95 |
.client-js body.ltr .vector-toc .vector-toc-toggle { |
| 96 |
transform: rotate( -90deg ); |
| 97 |
} |
| 98 |
|
| 99 |
.client-js body.rtl .vector-toc .vector-toc-toggle { |
| 100 |
transform: rotate( 90deg ); |
| 101 |
} |
| 102 |
|
| 103 |
// Ensure there is only 1 table of contents landmark at anytime |
| 104 |
.vector-toc-landmark { |
| 105 |
display: none; |
| 106 |
} |
| 107 |
|
| 108 |
.vector-feature-toc-pinned-clientpref-0 body:not( .vector-sticky-header-visible ) .vector-page-titlebar, |
| 109 |
.vector-feature-toc-pinned-clientpref-0 .vector-sticky-header-visible .vector-sticky-header-context-bar, |
| 110 |
.vector-feature-toc-pinned-clientpref-1 .vector-column-start { |
| 111 |
.vector-toc-landmark { |
| 112 |
display: block; |
| 113 |
} |
| 114 |
} |
| 115 |
|
| 116 |
// On smaller viewports the TOC will always be moved to the page titlebar via JS |
| 117 |
// regardless of the TOC pinned classes |
| 118 |
@media ( max-width: @max-width-breakpoint-tablet ) { |
| 119 |
.client-js .vector-page-titlebar .vector-toc-landmark { |
| 120 |
display: block; |
| 121 |
} |
| 122 |
|
| 123 |
.client-js .mw-table-of-contents-container.vector-toc-landmark { |
| 124 |
display: none; |
| 125 |
} |
| 126 |
} |