51 lines
2.5 KiB
CSS
51 lines
2.5 KiB
CSS
/* narrow.css — the book on a phone.
|
|
Nothing in the flow may be wider than the screen: a wide formula, table or
|
|
figure scrolls inside its own box instead of pushing the whole page
|
|
sideways (which leaves the text cut off at the left edge).
|
|
Loaded with calc-notes.css, so every page of every book gets it. */
|
|
|
|
/* --- display maths ------------------------------------------------------
|
|
The boxes of this extension (.calc, .exo, .further) already scroll their
|
|
own maths; this covers every other display formula on the page. */
|
|
:is(main, .quarto-title-block) :is(mjx-container[display="true"], .math.display) {
|
|
max-width: 100%;
|
|
overflow-x: auto;
|
|
overflow-y: hidden; /* Firefox computes phantom vertical overflow */
|
|
padding-bottom: 0.35em; /* keep descenders clear of a scrollbar */
|
|
/* a centred formula that overflows would hide its left side out of reach,
|
|
so centre it only while it fits */
|
|
justify-content: safe center;
|
|
}
|
|
|
|
/* --- everything else that can be wider than a phone ---------------------- */
|
|
main :is(pre, .sourceCode) { max-width: 100%; overflow-x: auto; }
|
|
main :is(img, svg) { max-width: 100%; height: auto; }
|
|
main table:not(.ltx-table) { display: block; max-width: 100%; overflow-x: auto; }
|
|
|
|
/* the animated figures of lesson-style chapters */
|
|
.notes-cantor, .notes-spiral, .notes-dominos { max-width: 100%; overflow-x: auto; }
|
|
|
|
/* the glossary popup: never wider than the screen */
|
|
.gls-float { max-width: min(92vw, 26rem); }
|
|
|
|
/* --- phone-sized screens ------------------------------------------------- */
|
|
@media (max-width: 575.98px) {
|
|
/* the equation number of a labelled calc block goes under the line, so the
|
|
formula keeps the full width */
|
|
.calc { grid-template-columns: max-content 1fr; }
|
|
|
|
/* figure captions and the fold summaries read better tight */
|
|
.exo, .further { padding-left: 0.6rem; padding-right: 0.6rem; }
|
|
|
|
/* A bare url in prose, or a long identifier in a code span, is one word to
|
|
the line breaker and paints past its block on a narrow screen — no
|
|
element is oversized, so only the text itself overflows. */
|
|
#quarto-document-content :is(a, code) { overflow-wrap: break-word; }
|
|
|
|
/* Quarto's own previous/next footer: the chapter titles are laid out in a
|
|
row that will not shrink, so a long title pushes the page sideways. */
|
|
.page-navigation { flex-wrap: wrap; row-gap: 0.75em; }
|
|
.nav-page, .nav-page .nav-page-text { min-width: 0; }
|
|
.nav-page .chapter-title { overflow-wrap: break-word; }
|
|
}
|