feat(toc): add wrapper for TOC link to hold summary

Some extensions such as DiscussionTools add summary to the ToC item.
We should add styles to support that
This commit is contained in:
alistair3149 2024-10-22 22:51:45 -04:00
parent 4849c648dc
commit 2157bcf490
No known key found for this signature in database
2 changed files with 14 additions and 7 deletions

View file

@ -28,6 +28,7 @@
padding: var( --space-xs );
font-weight: var( --font-weight-medium );
color: var( --color-emphasized );
border-radius: var( --border-radius-base );
&.citizen-toc-top {
height: 0;
@ -89,6 +90,11 @@
color: var( --color-subtle );
}
&-summary {
font-size: var( --font-size-x-small );
color: var( --color-subtle );
}
&-list-item {
position: relative;
@ -119,7 +125,7 @@
display: grid;
place-content: center;
cursor: pointer;
border-radius: var( --border-radius--small );
border-radius: var( --border-radius-base );
.citizen-ui-icon {
&::before {
@ -223,6 +229,7 @@
margin: 0;
background: transparent;
border: 0;
border-radius: 0;
box-shadow: none;
transform: none;

View file

@ -5,14 +5,14 @@
}}
<a class="citizen-toc-link" href="#{{linkAnchor}}{{^linkAnchor}}{{anchor}}{{/linkAnchor}}">
<div class="citizen-toc-indicator"></div>
<div class="citizen-toc-content">
<div class="citizen-toc-text">
<span class="citizen-toc-numb">{{number}}</span>
<span class="citizen-toc-heading">{{{line}}}</span>
</div>
{{#html-summary}}<div class="citizen-toc-summary">{{.}}</span>{{/html-summary}}
</div>
</a>
{{#html-summary}}
{{{.}}}
{{/html-summary}}
{{#is-top-level-section}}{{#is-parent-section}}
<button aria-controls="toc-{{anchor}}-sublist" class="citizen-toc-toggle">
<span class="citizen-ui-icon mw-ui-icon-wikimedia-collapse"></span>