|
| 1 | +/* ===== Draft Status Marking ===== */ |
| 2 | +/* Screen: a slim strip at the top of the content column that sticks below the |
| 3 | + site header as the document scrolls. |
| 4 | + Print: a band repeated at the top and bottom of every printed sheet. |
| 5 | + See src/components/DraftNotice.js. */ |
| 6 | + |
| 7 | +/* ── Screen: document status strip ── */ |
| 8 | +/* Bounded by the content column, not the viewport: a full-bleed bar reads as |
| 9 | + site-wide chrome, a column-width bar reads as status for this document. */ |
| 10 | +/* The anchor is the sticky element. It carries an opaque, page-coloured band so |
| 11 | + the gap above the strip is preserved as the document scrolls without text |
| 12 | + showing through it — the site header itself has a transparent background. */ |
| 13 | +.draft-strip-anchor { |
| 14 | + position: sticky; |
| 15 | + top: var(--ifm-navbar-height, 0px); |
| 16 | + z-index: 5; |
| 17 | + |
| 18 | + /* Holds the gap open as the document scrolls under it. Uses an explicit token |
| 19 | + rather than --ifm-background-color, which resolves to #0000 in light mode. */ |
| 20 | + padding-top: 1rem; |
| 21 | + padding-bottom: 0.35rem; |
| 22 | + /* Cancels the container's top spacing so the strip sits at its stuck position |
| 23 | + from first paint — it locks in place instead of shifting up on first scroll. */ |
| 24 | + margin-top: -1rem; |
| 25 | + margin-bottom: 0.7rem; |
| 26 | + background-color: var(--draft-strip-band); |
| 27 | +} |
| 28 | + |
| 29 | +.draft-strip { |
| 30 | + display: flex; |
| 31 | + align-items: baseline; |
| 32 | + justify-content: center; |
| 33 | + flex-wrap: wrap; |
| 34 | + gap: 0.45rem; |
| 35 | + |
| 36 | + padding: 0.4rem 0.9rem; |
| 37 | + border: 1px solid var(--draft-strip-border); |
| 38 | + border-radius: var(--ifm-global-radius); |
| 39 | + background-color: var(--draft-strip-bg); |
| 40 | + |
| 41 | + color: var(--draft-strip-fg); |
| 42 | + font-size: 0.8125rem; |
| 43 | + line-height: 1.3; |
| 44 | + text-align: center; |
| 45 | +} |
| 46 | + |
| 47 | +/* Light mode — lighter red */ |
| 48 | +:root { |
| 49 | + --draft-strip-bg: #fdf3e0; |
| 50 | + --draft-strip-border: #eed9ab; |
| 51 | + --draft-strip-fg: #6f4a08; |
| 52 | + --draft-strip-band: #f7f8fa; |
| 53 | +} |
| 54 | + |
| 55 | +/* Dark mode — darker red */ |
| 56 | +html[data-theme='dark'] { |
| 57 | + --draft-strip-bg: #33280f; |
| 58 | + --draft-strip-border: #6a5423; |
| 59 | + --draft-strip-fg: #f2e0be; |
| 60 | + --draft-strip-band: #1b1b1b; |
| 61 | +} |
| 62 | + |
| 63 | +@media (max-width: 480px) { |
| 64 | + .draft-strip { |
| 65 | + font-size: 0.75rem; |
| 66 | + padding: 0.35rem 0.7rem; |
| 67 | + } |
| 68 | +} |
| 69 | + |
| 70 | +/* ── Print frame: inert on screen ── */ |
| 71 | +/* display: contents makes the wrapper generate no boxes, so the document lays |
| 72 | + out exactly as it would without the table. */ |
| 73 | +.draft-print-frame, |
| 74 | +.draft-print-frame > thead, |
| 75 | +.draft-print-frame > tbody, |
| 76 | +.draft-print-frame > tfoot, |
| 77 | +.draft-print-frame > * > tr, |
| 78 | +.draft-print-frame > * > tr > td { |
| 79 | + display: contents; |
| 80 | +} |
| 81 | + |
| 82 | +.draft-print-frame__band { |
| 83 | + display: none; |
| 84 | +} |
| 85 | + |
| 86 | +/* ── Print ── */ |
| 87 | +@media print { |
| 88 | + /* The viewport strip is a screen affordance; the repeating band replaces it. */ |
| 89 | + .draft-strip-anchor { |
| 90 | + display: none !important; |
| 91 | + } |
| 92 | + |
| 93 | + .draft-print-frame { |
| 94 | + display: table !important; |
| 95 | + width: 100% !important; |
| 96 | + border-collapse: collapse !important; |
| 97 | + } |
| 98 | + |
| 99 | + /* thead/tfoot repeat across page breaks — this is what marks every sheet. */ |
| 100 | + .draft-print-frame > thead { |
| 101 | + display: table-header-group !important; |
| 102 | + } |
| 103 | + |
| 104 | + .draft-print-frame > tfoot { |
| 105 | + display: table-footer-group !important; |
| 106 | + } |
| 107 | + |
| 108 | + .draft-print-frame > tbody { |
| 109 | + display: table-row-group !important; |
| 110 | + } |
| 111 | + |
| 112 | + .draft-print-frame > * > tr { |
| 113 | + display: table-row !important; |
| 114 | + } |
| 115 | + |
| 116 | + .draft-print-frame > * > tr > td { |
| 117 | + display: table-cell !important; |
| 118 | + border: 0 !important; |
| 119 | + padding: 0 !important; |
| 120 | + } |
| 121 | + |
| 122 | + /* Class specificity beats the `* { color: #000 !important }` reset in print.css. */ |
| 123 | + .draft-print-frame__band { |
| 124 | + display: block !important; |
| 125 | + margin: 0 0 8pt !important; |
| 126 | + padding: 3pt 0 !important; |
| 127 | + border-top: 1pt solid #8a5a00 !important; |
| 128 | + border-bottom: 1pt solid #8a5a00 !important; |
| 129 | + color: #8a5a00 !important; |
| 130 | + font-size: 8.5pt !important; |
| 131 | + font-weight: 700 !important; |
| 132 | + letter-spacing: 0.06em; |
| 133 | + text-align: center; |
| 134 | + -webkit-print-color-adjust: exact; |
| 135 | + print-color-adjust: exact; |
| 136 | + } |
| 137 | + |
| 138 | + .draft-print-frame__band--foot { |
| 139 | + margin: 8pt 0 0 !important; |
| 140 | + } |
| 141 | +} |
0 commit comments