| 1 | /* history.css: the History panel and a version on show (level-up §4.5). |
| 2 | * |
| 3 | * The panel is 360px at the inline end, full height under the bar. From |
| 4 | * 800px the page column makes room for it, as a third column of |
| 5 | * [mapa-app]; below 800px it is the whole screen for the list, and |
| 6 | * follows the version it shows. It replaces the Links panel while open. |
| 7 | * Tokens only, so Calma and light/dark apply. |
| 8 | */ |
| 9 | |
| 10 | @media (min-width: 800px) { |
| 11 | [mapa-app][data-history] { |
| 12 | grid-template-columns: var(--mapa-side-w) minmax(0, 1fr) 360px; |
| 13 | } |
| 14 | } |
| 15 | [mapa-app][data-history] #mapa-links { display: none; } |
| 16 | |
| 17 | [mapa-history] { |
| 18 | box-sizing: border-box; |
| 19 | position: sticky; |
| 20 | inset-block-start: var(--mapa-bar-h); |
| 21 | block-size: calc(100dvh - var(--mapa-bar-h)); |
| 22 | display: flex; |
| 23 | flex-direction: column; |
| 24 | min-inline-size: 0; |
| 25 | background: var(--rst-surface); |
| 26 | border-inline-start: 1px solid var(--rst-line); |
| 27 | box-shadow: -24px 0 48px -32px light-dark(rgb(20 24 33 / 0.35), rgb(0 0 0 / 0.7)); |
| 28 | } |
| 29 | [mapa-history-head] { |
| 30 | display: flex; |
| 31 | align-items: center; |
| 32 | justify-content: space-between; |
| 33 | padding: var(--rst-sp-4) var(--rst-sp-3) var(--rst-sp-2) var(--rst-sp-5); |
| 34 | } |
| 35 | [mapa-history-head] h2 { margin: 0; font-size: 16px; font-weight: 680; } |
| 36 | [mapa-history-head] h2:focus { outline: none; } |
| 37 | [mapa-history-close] { |
| 38 | display: inline-grid; |
| 39 | place-items: center; |
| 40 | inline-size: 32px; |
| 41 | block-size: 32px; |
| 42 | border-radius: 8px; |
| 43 | color: var(--rst-text-muted); |
| 44 | } |
| 45 | [mapa-history-close]:hover { background: var(--rst-surface-2); color: var(--rst-text); } |
| 46 | [mapa-history-close]:focus-visible { outline: 2px solid var(--rst-accent); outline-offset: -2px; } |
| 47 | [mapa-history-close] svg { inline-size: 18px; block-size: 18px; } |
| 48 | [mapa-history-lede] { |
| 49 | margin: 0 var(--rst-sp-5) var(--rst-sp-3); |
| 50 | color: var(--rst-text-muted); |
| 51 | font-size: 12.5px; |
| 52 | line-height: 1.45; |
| 53 | } |
| 54 | [mapa-history-list] { flex: 1; overflow: auto; padding: 0 var(--rst-sp-3) var(--rst-sp-3); } |
| 55 | [mapa-history-list] h3 { |
| 56 | margin: var(--rst-sp-3) var(--rst-sp-2) var(--rst-sp-1); |
| 57 | color: var(--rst-text-faint, var(--rst-text-muted)); |
| 58 | font-size: 11.5px; |
| 59 | font-weight: 600; |
| 60 | } |
| 61 | [mapa-history-list] ul { margin: 0; padding: 0; list-style: none; } |
| 62 | [mapa-ver] { |
| 63 | display: grid; |
| 64 | grid-template-columns: 28px minmax(0, 1fr) auto; |
| 65 | column-gap: var(--rst-sp-2); |
| 66 | align-items: center; |
| 67 | padding: var(--rst-sp-2); |
| 68 | border-radius: 10px; |
| 69 | color: inherit; |
| 70 | font-size: 13px; |
| 71 | text-decoration: none; |
| 72 | } |
| 73 | [mapa-ver]:hover { background: var(--rst-surface-2); } |
| 74 | [mapa-ver]:focus-visible { outline: 2px solid var(--rst-accent); outline-offset: -2px; } |
| 75 | [mapa-ver][aria-current] { background: var(--rst-accent-soft); } |
| 76 | [mapa-ver-main] { min-inline-size: 0; } |
| 77 | [mapa-ver] b { font-weight: 650; } |
| 78 | [mapa-ver-now] { color: var(--rst-text-muted); font-size: 11.5px; font-weight: 600; } |
| 79 | [mapa-ver] small { |
| 80 | display: block; |
| 81 | overflow: hidden; |
| 82 | color: var(--rst-text-muted); |
| 83 | font-size: 12px; |
| 84 | text-overflow: ellipsis; |
| 85 | white-space: nowrap; |
| 86 | } |
| 87 | [mapa-ver] time { |
| 88 | align-self: start; |
| 89 | padding-block-start: 2px; /* spacing-allow: the time's first line sits on the title's, a smaller face on a larger one */ |
| 90 | color: var(--rst-text-muted); |
| 91 | font-size: 12px; |
| 92 | font-variant-numeric: tabular-nums; |
| 93 | } |
| 94 | [mapa-ava] { |
| 95 | display: inline-grid; |
| 96 | place-items: center; |
| 97 | inline-size: 28px; |
| 98 | block-size: 28px; |
| 99 | border-radius: 50%; |
| 100 | background: var(--rst-surface-2); |
| 101 | color: var(--rst-text-muted); |
| 102 | font: 700 11px/1 var(--rst-font); |
| 103 | } |
| 104 | [mapa-history-note] { margin: var(--rst-sp-3) var(--rst-sp-2) var(--rst-sp-1); color: var(--rst-text-muted); font-size: 12.5px; } |
| 105 | [mapa-history-more] { margin: var(--rst-sp-2) var(--rst-sp-2) 0; } |
| 106 | [mapa-history-foot] { |
| 107 | display: flex; |
| 108 | flex-wrap: wrap; |
| 109 | justify-content: flex-end; |
| 110 | gap: var(--rst-sp-2); |
| 111 | padding: var(--rst-sp-3) var(--rst-sp-4); |
| 112 | border-block-start: 1px solid var(--rst-line); |
| 113 | } |
| 114 | [mapa-history-foot] form { display: contents; } |
| 115 | [mapa-history-foot] svg { inline-size: 16px; block-size: 16px; } |
| 116 | |
| 117 | /* Below 800px: the list is the screen; a version shows first, and the |
| 118 | panel follows it. */ |
| 119 | @media (max-width: 799.98px) { |
| 120 | [mapa-history] { |
| 121 | position: static; |
| 122 | block-size: auto; |
| 123 | border-inline-start: 0; |
| 124 | box-shadow: none; |
| 125 | } |
| 126 | [mapa-app][data-history="list"] [mapa-main] { display: none; } |
| 127 | [mapa-app][data-history="list"] [mapa-history] { min-block-size: calc(100dvh - var(--mapa-bar-h)); } |
| 128 | [mapa-app][data-history="version"] [mapa-history] { border-block-start: 1px solid var(--rst-line); } |
| 129 | [mapa-history-list] { overflow: visible; } |
| 130 | } |
| 131 | |
| 132 | /* ── A version on show: the banner, then the page as it was, with what |
| 133 | changed marked. ── */ |
| 134 | [mapa-version-bar] { |
| 135 | display: flex; |
| 136 | flex-wrap: wrap; |
| 137 | align-items: center; |
| 138 | gap: var(--rst-sp-2) var(--rst-sp-3); |
| 139 | padding: var(--rst-sp-2) var(--rst-sp-3); |
| 140 | border: 1px solid var(--rst-line); |
| 141 | border-radius: 12px; |
| 142 | background: var(--rst-surface-2); |
| 143 | font-size: 13px; |
| 144 | } |
| 145 | [mapa-version-bar] > span { flex: 1 1 14rem; color: var(--rst-text-muted); } |
| 146 | [mapa-version-bar] > span b { color: var(--rst-text); } |
| 147 | [mapa-version] ins, |
| 148 | h1[mapa-title] ins { |
| 149 | border-radius: 3px; |
| 150 | background: var(--rst-tone-positive-bg); |
| 151 | color: var(--rst-text); |
| 152 | text-decoration: underline 2px; |
| 153 | text-decoration-color: var(--rst-tone-positive-fg); |
| 154 | text-underline-offset: 3px; |
| 155 | } |
| 156 | [mapa-version] del, |
| 157 | h1[mapa-title] del { |
| 158 | border-radius: 3px; |
| 159 | background: var(--rst-tone-negative-bg); |
| 160 | color: var(--rst-text-muted); |
| 161 | text-decoration: line-through 1.5px; |
| 162 | text-decoration-color: var(--rst-tone-negative-fg); |
| 163 | } |
| 164 | [mapa-diff] > ul, [mapa-diff] > ol { margin-block: 0; } |
| 165 | [mapa-diff-level="1"] { margin-inline-start: 1.5em; /* spacing-allow: a list level's indent in the document, as prose.css draws it */ } |
| 166 | [mapa-diff-level="2"] { margin-inline-start: 3em; /* spacing-allow: two levels, as above */ } |
| 167 | [mapa-diff-level="3"] { margin-inline-start: 4.5em; /* spacing-allow: three levels, as above */ } |
| 168 | [mapa-diff-link] { |
| 169 | padding: 0 var(--rst-sp-1); |
| 170 | border: 1px solid var(--rst-line); |
| 171 | border-radius: 5px; |
| 172 | } |
| 173 | |
| 174 | /* While History is open the Links panel is not, so the page column |
| 175 | makes no room for it: the history column already took its own. */ |
| 176 | @media (min-width: 64rem) { |
| 177 | [mapa-app][data-history][data-links="open"] [mapa-doc] { padding-inline-end: 48px; /* spacing-allow: the measure's own 48px, as frame.css's */ } |
| 178 | [mapa-app][data-history][data-links="open"] [mapa-foot-refs] { display: flex; } |
| 179 | } |
| 180 | |