| 1 |
@import '../../../minerva.less/minerva.variables.less'; |
| 2 |
|
| 3 |
@toc-large-icon: 44px; |
| 4 |
@toc-small-icon: 34px; |
| 5 |
|
| 6 |
.toc { |
| 7 |
display: none; |
| 8 |
position: relative; |
| 9 |
margin: 1em 0; |
| 10 |
padding: 0 1em 1em 1em; |
| 11 |
background-color: @background-color-interactive-subtle; |
| 12 |
border: @border-width-base @border-style-base @border-color-muted; |
| 13 |
box-sizing: border-box; |
| 14 |
|
| 15 |
// We need high specificity to override .content ul |
| 16 |
&.toc > ul { |
| 17 |
// Account for the icon spaces left and right. |
| 18 |
// margin: 0 @toc-small-icon 0 @toc-large-icon; |
| 19 |
font-size: @font-size-minerva-small; |
| 20 |
// Reset `.client-js .toc > ul`. |
| 21 |
padding-left: 0; |
| 22 |
} |
| 23 |
|
| 24 |
// We need high specificity to override .content ul |
| 25 |
&.toc ul { |
| 26 |
list-style: none; |
| 27 |
// break long headings like urls |
| 28 |
word-break: break-word; |
| 29 |
} |
| 30 |
} |
| 31 |
|
| 32 |
.toctitle { |
| 33 |
@toctitle-vertical-padding: 1.4em / 2; |
| 34 |
font-weight: bold; |
| 35 |
display: flex; |
| 36 |
// Force vertical centering on title by making this full height |
| 37 |
align-items: center; |
| 38 |
// Ensure height for icon |
| 39 |
min-height: @toc-large-icon; |
| 40 |
|
| 41 |
// We need high specificity to override .content h2 |
| 42 |
&.toctitle h2 { |
| 43 |
display: inline-block; |
| 44 |
font-family: @font-family-base; |
| 45 |
font-size: unit( 18/16, em ); |
| 46 |
vertical-align: middle; |
| 47 |
flex-grow: 1; |
| 48 |
margin-left: @toc-large-icon; |
| 49 |
margin-right: @toc-large-icon; |
| 50 |
} |
| 51 |
} |
| 52 |
|
| 53 |
.tocnumber { |
| 54 |
display: none; |
| 55 |
} |
| 56 |
|
| 57 |
.toctogglelabel { |
| 58 |
position: absolute; |
| 59 |
left: 0; |
| 60 |
top: 0; |
| 61 |
right: 0; |
| 62 |
height: @toc-large-icon; |
| 63 |
z-index: @z-index-above-content; |
| 64 |
} |
| 65 |
|
| 66 |
// Do stuff we only need to do with JS |
| 67 |
// Collapsing and reserving space for the JS icons |
| 68 |
.client-js .toc { |
| 69 |
// Reset padding, because we need to reserve space for icons |
| 70 |
padding: 0; |
| 71 |
|
| 72 |
> ul { |
| 73 |
// Account for the icon spaces left and right. |
| 74 |
margin: 0 @toc-small-icon 0 @toc-large-icon; |
| 75 |
} |
| 76 |
|
| 77 |
.toctogglecheckbox ~ ul { |
| 78 |
visibility: hidden; |
| 79 |
height: 0; |
| 80 |
} |
| 81 |
|
| 82 |
.toctogglecheckbox:checked ~ ul { |
| 83 |
visibility: visible; |
| 84 |
padding-bottom: 20px; |
| 85 |
height: auto; |
| 86 |
} |
| 87 |
|
| 88 |
.toctogglelabel { |
| 89 |
cursor: pointer; |
| 90 |
} |
| 91 |
} |
| 92 |
|
| 93 |
@media screen and ( min-width: @min-width-breakpoint-tablet ) { |
| 94 |
.toc { |
| 95 |
// Reset the rule for mobile mode |
| 96 |
display: table; |
| 97 |
|
| 98 |
.toctitle { |
| 99 |
visibility: visible; |
| 100 |
} |
| 101 |
} |
| 102 |
} |