Show the ToC on the left margin if enough space is available

This commit is contained in:
Jonas Schäfer 2019-04-04 16:49:29 +02:00
parent 39199b23d8
commit 48e6477b98
2 changed files with 39 additions and 1 deletions

View File

@ -228,7 +228,9 @@ OR OTHER DEALINGS IN THE SOFTWARE.
<!-- COUNCIL NOTE -->
<xsl:apply-templates select='/xep/header/councilnote'/>
<!-- TABLE OF CONTENTS -->
<xsl:call-template name='processTOC' />
<nav id="toc">
<xsl:call-template name='processTOC' />
</nav>
<!-- END FRONT MATTER -->
<!-- BEGIN XEP CONTENTS -->
<xsl:apply-templates select='/xep/section1'/>

View File

@ -661,3 +661,39 @@
counter-increment: item;
}
}
@media screen and ( min-width: 75em ) {
body {
margin-right: 0;
margin-left: auto;
max-width: 60em;
}
nav#toc {
position: fixed;
left: 0;
top: 0;
bottom: 0;
width: 15em;
width: calc((100vw - 60em) - 2em);
padding: 0.5em;
overflow-y: scroll;
}
nav#toc > h2 {
font-size: 128.57143%;
line-height: 1.16667;
margin: 0 0 1.16667em 0;
}
}
@media screen and ( min-width: 90em ) {
body {
margin-left: auto;
margin-right: auto;
}
nav#toc {
width: calc((100vw - 60em) / 2 - 2em);
}
}