mirror of
https://github.com/StarCitizenTools/mediawiki-skins-Citizen.git
synced 2024-11-24 06:24:22 +00:00
refactor(core): ♻️ wrap ToC inside citizen-body-sidebar
This commit is contained in:
parent
8c6cb3525c
commit
9da91018ab
|
@ -0,0 +1,5 @@
|
|||
.citizen-body-sidebar {
|
||||
@media ( min-width: @min-width-breakpoint-desktop ) {
|
||||
grid-area: sidebar;
|
||||
}
|
||||
}
|
|
@ -206,27 +206,16 @@
|
|||
|
||||
@media ( min-width: @min-width-breakpoint-desktop ) {
|
||||
.citizen-toc {
|
||||
grid-area: toc;
|
||||
--toc-margin-top: var( --space-xs );
|
||||
position: -webkit-sticky;
|
||||
position: sticky;
|
||||
top: var( --toc-margin-top );
|
||||
max-height: ~'calc( 100vh - var( --toc-margin-top ) - var( --space-md ) )';
|
||||
overflow-y: auto;
|
||||
overscroll-behavior: contain;
|
||||
|
||||
&__card {
|
||||
--toc-margin-top: var( --space-xs );
|
||||
position: -webkit-sticky;
|
||||
position: sticky;
|
||||
top: var( --toc-margin-top );
|
||||
max-height: ~'calc( 100vh - var( --toc-margin-top ) - var( --space-md ) )';
|
||||
overflow-y: auto;
|
||||
overscroll-behavior: contain;
|
||||
}
|
||||
}
|
||||
|
||||
// Hide button in desktop viewport
|
||||
#citizen-toc__buttonCheckbox {
|
||||
display: none;
|
||||
}
|
||||
|
||||
// Sticky header styles
|
||||
.citizen-body-header--sticky {
|
||||
.citizen-toc__card {
|
||||
// Sticky header styles
|
||||
.citizen-body-header--sticky & {
|
||||
--toc-margin-top: ~'calc( var( --header-size ) + var( --space-xxl ) )';
|
||||
|
||||
// Sticky header is shorter without buttons
|
||||
|
@ -235,4 +224,9 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Hide button in desktop viewport
|
||||
#citizen-toc__buttonCheckbox {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -62,7 +62,7 @@
|
|||
display: grid;
|
||||
grid-template-areas:
|
||||
'header header'
|
||||
'content toc'
|
||||
'content sidebar'
|
||||
'footer footer';
|
||||
grid-template-columns: minmax( 0, var( --width-layout ) ) var( --width-toc );
|
||||
}
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
@import 'components/Pagetools.less';
|
||||
@import 'components/Menu.less';
|
||||
@import 'components/ContentHeader.less';
|
||||
@import 'components/ContentSidebar.less';
|
||||
@import 'components/ContentFooter.less';
|
||||
@import 'components/Footer.less';
|
||||
@import 'components/TableOfContents.less';
|
||||
|
|
6
templates/ContentSidebar.mustache
Normal file
6
templates/ContentSidebar.mustache
Normal file
|
@ -0,0 +1,6 @@
|
|||
{{!
|
||||
|
||||
}}
|
||||
<div class="citizen-body-sidebar">
|
||||
{{>TableOfContents}}
|
||||
</div>
|
|
@ -22,7 +22,7 @@
|
|||
{{{html-user-message}}}
|
||||
{{{html-body-content--formatted}}}
|
||||
</div>
|
||||
{{#toc-enabled}}{{>TableOfContents}}{{/toc-enabled}}
|
||||
{{#toc-enabled}}{{>ContentSidebar}}{{/toc-enabled}}
|
||||
{{>ContentFooter}}
|
||||
</div>
|
||||
</main>
|
||||
|
|
Loading…
Reference in a new issue