|
21 | 21 | min-height: 0; |
22 | 22 | } |
23 | 23 |
|
24 | | -// Footer chrome — two layouts driven by `is-wide` / `is-narrow` modifier |
25 | | -// classes set from the media editor at the sidebar-collapse breakpoint. |
26 | | -// Wide is a single flex row (History | Cancel/Save); narrow stacks via |
27 | | -// `flex-direction: column` (image controls above the History | |
28 | | -// Cancel/Save row). Each layout has its own JSX tree (not `order` |
29 | | -// reshuffling, which the project's stylelint rule treats as an a11y red |
30 | | -// flag), so DOM order always matches visual order. |
| 24 | +// Footer chrome. The image controls live under the canvas at every viewport, |
| 25 | +// so the footer has a single layout at every width: History on the left, |
| 26 | +// Cancel/Save on the right. |
31 | 27 | .media-editor-modal.components-modal__frame .media-editor-modal__footer { |
32 | 28 | flex-shrink: 0; |
33 | 29 | display: flex; |
34 | | - gap: $grid-unit-20; |
35 | | - // Borderless: sections are demarcated by the inset canvas panel and |
36 | | - // spacing, not divider lines. 16px top / 32px sides / 24px bottom. |
37 | | - padding: $grid-unit-20 $grid-unit-40 $grid-unit-30; |
38 | | - background: $white; |
39 | | - // Above the `.interface-interface-skeleton__sidebar` which has a z-index of 100000. |
40 | | - z-index: z-index(".media-editor-modal__footer"); |
41 | | - |
42 | | - &.is-wide { |
43 | | - flex-direction: row; |
44 | | - align-items: center; |
45 | | - |
46 | | - // Panel mode: the footer holds only History (left) and |
47 | | - // Cancel/Save (right). `margin-left: auto` pins the actions to the |
48 | | - // right edge whether or not History renders (e.g. non-image |
49 | | - // attachments show only `SaveActions`). |
50 | | - .media-editor__save-actions { |
51 | | - margin-left: auto; |
52 | | - } |
53 | | - } |
54 | | - |
55 | | - &.is-narrow { |
56 | | - flex-direction: column; |
57 | | - } |
58 | | - |
59 | | - // Narrow only: image controls sit on their own row, centered. |
60 | | - &.is-narrow > .media-editor-image-controls { |
61 | | - align-self: center; |
62 | | - } |
63 | | -} |
64 | | - |
65 | | -// Secondary row used by medium (History + Image controls + Cancel/Save) and |
66 | | -// narrow (History + Cancel/Save). `margin-left: auto` on the image controls |
67 | | -// cluster and on Cancel/Save splits any free space — History gets the |
68 | | -// left edge, Cancel/Save the right edge, and the image controls (when |
69 | | -// present, i.e. medium only) approximately centers. Exact centering only |
70 | | -// holds when History and Cancel/Save have matching widths; in practice |
71 | | -// they're close enough that the offset is imperceptible. |
72 | | -.media-editor-modal__footer-row { |
73 | | - display: flex; |
74 | | - flex-wrap: wrap; |
| 30 | + flex-direction: row; |
75 | 31 | align-items: center; |
76 | 32 | gap: $grid-unit-20; |
| 33 | + padding: $grid-unit-30; |
| 34 | + background: $white; |
77 | 35 |
|
78 | | - .media-editor-image-controls, |
| 36 | + // `margin-left: auto` pins the actions to the right edge whether or not |
| 37 | + // History renders (e.g. non-image attachments show only `SaveActions`). |
79 | 38 | .media-editor__save-actions { |
80 | 39 | margin-left: auto; |
81 | 40 | } |
|
0 commit comments