|
1 | | -/* Mobile-first. Single column; the layout never splits — wider screens just |
2 | | - get more breathing room. */ |
| 1 | +/* Mobile-first. Single column below the wide-desktop breakpoint — wider |
| 2 | + screens up to that point just get more breathing room, same as before. |
| 3 | + At the wide-desktop tier (see "#form-view: two-column layout" further |
| 4 | + down), the form view splits into a form column and a live preview |
| 5 | + column side by side; every other view stays single-column at every |
| 6 | + width. */ |
3 | 7 |
|
4 | 8 | :root { |
5 | 9 | --bg: #f6f7f9; |
@@ -36,6 +40,16 @@ body { |
36 | 40 | -webkit-font-smoothing: antialiased; |
37 | 41 | } |
38 | 42 |
|
| 43 | +/* Matches the two-column form/preview layout's own total width (see |
| 44 | + "#form-view: two-column layout" further down) — every view (header, |
| 45 | + footer, the events list) gets the same wider column at this tier, not |
| 46 | + just the form. */ |
| 47 | +@media (min-width: 72rem) { |
| 48 | + body { |
| 49 | + max-width: 72rem; |
| 50 | + } |
| 51 | +} |
| 52 | + |
39 | 53 | /* --- header ------------------------------------------------------------- */ |
40 | 54 |
|
41 | 55 | header { |
@@ -223,6 +237,12 @@ header h1 { |
223 | 237 | outline-offset: 2px; |
224 | 238 | } |
225 | 239 |
|
| 240 | +/* Form/Preview switch — narrow viewports only, see "#form-view: two-column |
| 241 | + layout" for the wide-breakpoint override that hides this entirely. */ |
| 242 | +#preview-toggle { |
| 243 | + margin: 0 0 0.75rem; |
| 244 | +} |
| 245 | + |
226 | 246 | .description-toolbar { |
227 | 247 | display: flex; |
228 | 248 | align-items: center; |
@@ -1537,6 +1557,66 @@ select { |
1537 | 1557 | padding: 0.6rem 0.85rem 0.6rem 2rem; |
1538 | 1558 | } |
1539 | 1559 |
|
| 1560 | +/* --- form/preview layout ---------------------------------------------------- */ |
| 1561 | + |
| 1562 | +/* Mobile-first default: the live preview column is off-screen entirely, |
| 1563 | + and #preview-toggle (in #form-column) switches which one of |
| 1564 | + #form-column/#preview-column is shown. Below the wide-desktop tier this |
| 1565 | + stays a single column throughout, same as every other view in the app. */ |
| 1566 | +#preview-column { |
| 1567 | + display: none; |
| 1568 | +} |
| 1569 | + |
| 1570 | +#form-view[data-mobile-tab="preview"] #form-column { |
| 1571 | + display: none; |
| 1572 | +} |
| 1573 | + |
| 1574 | +#form-view[data-mobile-tab="preview"] #preview-column { |
| 1575 | + display: block; |
| 1576 | +} |
| 1577 | + |
| 1578 | +@media (min-width: 72rem) { |
| 1579 | + /* Two-column layout: form on the left, live preview on the right, both |
| 1580 | + always visible — #preview-toggle is hidden below (nothing to switch |
| 1581 | + between anymore). 44rem + 2rem gap + 26rem = 72rem, matching this |
| 1582 | + tier's own min-width and this file's widened `body` max-width, so the |
| 1583 | + grid never renders cramped right at the breakpoint edge. */ |
| 1584 | + #form-view:not([hidden]) { |
| 1585 | + display: grid; |
| 1586 | + grid-template-columns: 44rem 26rem; |
| 1587 | + gap: 2rem; |
| 1588 | + align-items: start; |
| 1589 | + } |
| 1590 | + |
| 1591 | + #preview-toggle { |
| 1592 | + display: none; |
| 1593 | + } |
| 1594 | + |
| 1595 | + /* Matches the specificity of the mobile-tab rules above |
| 1596 | + (#form-view[data-mobile-tab="…"] #form-column/#preview-column) so this |
| 1597 | + override actually wins by source order — a plain `#form-column, |
| 1598 | + #preview-column { display: block }` here would lose to those rules |
| 1599 | + whenever data-mobile-tab happens to still be "preview" from a narrower |
| 1600 | + viewport (main.ts doesn't reset it on resize). */ |
| 1601 | + #form-view[data-mobile-tab="form"] #form-column, |
| 1602 | + #form-view[data-mobile-tab="preview"] #form-column, |
| 1603 | + #form-view[data-mobile-tab="form"] #preview-column, |
| 1604 | + #form-view[data-mobile-tab="preview"] #preview-column { |
| 1605 | + display: block; |
| 1606 | + } |
| 1607 | + |
| 1608 | + #preview-column { |
| 1609 | + position: sticky; |
| 1610 | + top: 1rem; |
| 1611 | + } |
| 1612 | + |
| 1613 | + #preview-column h2 { |
| 1614 | + margin: 0 0 0.6rem; |
| 1615 | + font-size: 1rem; |
| 1616 | + color: var(--muted); |
| 1617 | + } |
| 1618 | +} |
| 1619 | + |
1540 | 1620 | /* --- action bar ------------------------------------------------------------- */ |
1541 | 1621 |
|
1542 | 1622 | /* :not([hidden]) — bulk-edit mode toggles this off in favor of |
@@ -1608,6 +1688,16 @@ select { |
1608 | 1688 | } |
1609 | 1689 | } |
1610 | 1690 |
|
| 1691 | +@media (min-width: 72rem) { |
| 1692 | + /* Same centering mechanism as the 52rem tier above, just spanning the |
| 1693 | + wider two-column content width (form + gap + preview, see "#form-view: |
| 1694 | + two-column layout") instead of the single form column — the action bar |
| 1695 | + reads as applying to the whole page, not just the form side. */ |
| 1696 | + #action-bar:not([hidden]) { |
| 1697 | + width: 72rem; |
| 1698 | + } |
| 1699 | +} |
| 1700 | + |
1611 | 1701 | /* --- buttons -------------------------------------------------------------- */ |
1612 | 1702 |
|
1613 | 1703 | button { |
|
0 commit comments