diff options
| author | erdgeist <erdgeist@erdgeist.org> | 2026-07-14 04:10:01 +0200 |
|---|---|---|
| committer | erdgeist <erdgeist@erdgeist.org> | 2026-07-14 04:10:01 +0200 |
| commit | e0f2394fd0816ef03bf4b928ab9fa5a18c32ffda (patch) | |
| tree | 0c346c5167c06f1bd4be03c8fd4e358215ed2fbe /public/stylesheets/admin.css | |
| parent | 88ebeaac7fcf140cbab489e841bf9c197f84c4ea (diff) | |
Add a toggleable live preview panel to both editors
Hidden by default, shares horizontal space with the body editor once
opened rather than a separate section, and only requests the iframe's
src on first toggle -- no preview traffic at all until someone
actually wants to see it. Refreshes automatically on every successful
autosave; a separate force-render button re-attempts a save-and-
refresh cycle immediately, for when the normal 7-second cycle has
been interrupted (a lock-lost error, a transient failure) and waiting
for the next tick isn't good enough.
Diffstat (limited to 'public/stylesheets/admin.css')
| -rw-r--r-- | public/stylesheets/admin.css | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/public/stylesheets/admin.css b/public/stylesheets/admin.css index 93cc3f5..5f7723b 100644 --- a/public/stylesheets/admin.css +++ b/public/stylesheets/admin.css | |||
| @@ -683,6 +683,10 @@ table.user_table td.user_login { | |||
| 683 | display: block; | 683 | display: block; |
| 684 | margin-bottom: 1rem; | 684 | margin-bottom: 1rem; |
| 685 | } | 685 | } |
| 686 | |||
| 687 | .body_toolbar_row { | ||
| 688 | margin-left: 120px; | ||
| 689 | } | ||
| 686 | } | 690 | } |
| 687 | @media(max-width:1015px) { | 691 | @media(max-width:1015px) { |
| 688 | div.node_description { | 692 | div.node_description { |
| @@ -1324,3 +1328,67 @@ div#image_browser ul li { | |||
| 1324 | border-radius: 4px; | 1328 | border-radius: 4px; |
| 1325 | } | 1329 | } |
| 1326 | 1330 | ||
| 1331 | /* ============================================================ | ||
| 1332 | Live edit preview | ||
| 1333 | ============================================================ */ | ||
| 1334 | |||
| 1335 | #editor_and_preview { | ||
| 1336 | display: flex; | ||
| 1337 | flex-direction: column; | ||
| 1338 | gap: 1.5rem; | ||
| 1339 | } | ||
| 1340 | |||
| 1341 | @media (min-width: 1016px) { | ||
| 1342 | #editor_and_preview { | ||
| 1343 | flex-direction: row; | ||
| 1344 | align-items: flex-start; | ||
| 1345 | } | ||
| 1346 | |||
| 1347 | #editor_and_preview .preview_content { | ||
| 1348 | flex: 1; | ||
| 1349 | min-width: 0; | ||
| 1350 | } | ||
| 1351 | |||
| 1352 | #preview_panel { | ||
| 1353 | flex: 1; | ||
| 1354 | min-width: 0; | ||
| 1355 | } | ||
| 1356 | } | ||
| 1357 | |||
| 1358 | #preview_panel iframe { | ||
| 1359 | width: 100%; | ||
| 1360 | height: 612px; | ||
| 1361 | border: 0.5px solid var(--border); | ||
| 1362 | border-radius: var(--radius); | ||
| 1363 | } | ||
| 1364 | |||
| 1365 | .body_toolbar_row { | ||
| 1366 | min-height: 2rem; | ||
| 1367 | margin-bottom: 1rem; | ||
| 1368 | display: flex; | ||
| 1369 | gap: 8px; | ||
| 1370 | } | ||
| 1371 | |||
| 1372 | .view_toggle { | ||
| 1373 | background: #f7f7f7; | ||
| 1374 | border: 1px solid #ddd; | ||
| 1375 | border-radius: 4px; | ||
| 1376 | padding: 4px 8px; | ||
| 1377 | cursor: pointer; | ||
| 1378 | color: #555; | ||
| 1379 | display: flex; | ||
| 1380 | align-items: center; | ||
| 1381 | gap: 1em; | ||
| 1382 | } | ||
| 1383 | |||
| 1384 | .view_toggle:hover { | ||
| 1385 | background: #ececec; | ||
| 1386 | border-color: #ccc; | ||
| 1387 | color: #222; | ||
| 1388 | } | ||
| 1389 | |||
| 1390 | .view_toggle[aria-pressed="true"] { | ||
| 1391 | background: #dde8f5; | ||
| 1392 | border-color: #a9c6e8; | ||
| 1393 | color: #1a4d8f; | ||
| 1394 | } | ||
