|
1 | 1 | // Route-level styles for the modernized Backup dashboard. |
2 | 2 | // Per-component styles live alongside each component under |
3 | | -// src/dashboard/components/*. This file is intentionally minimal for |
4 | | -// Task 1; later tasks add layout rules for the two-pane Overview here. |
| 3 | +// src/dashboard/components/*. |
| 4 | + |
| 5 | +@use "sass:meta"; |
| 6 | +@use "@automattic/jetpack-base-styles/admin-page-layout" as *; |
| 7 | + |
| 8 | +// Pull in the bundled DataViews stylesheet. `@wordpress/dataviews` ships |
| 9 | +// its CSS in `build-style/style.css` rather than auto-injecting it from |
| 10 | +// the JS entry, so we explicitly @include it once at the route level |
| 11 | +// (mirrors VideoPress's `routes/library/style.scss`). Without this the |
| 12 | +// list-layout primary action button falls back to wp-admin's default |
| 13 | +// browser button styling and shows as a visible artifact in every row. |
| 14 | +@include meta.load-css("@wordpress/dataviews/build-style/style.css"); |
| 15 | + |
| 16 | +// Pin the wp-admin content column to the viewport and turn its inner |
| 17 | +// flex chain into "fixed header + scrollable middle + pinned footer" |
| 18 | +// — matches the modernized VideoPress / Forms dashboards (see |
| 19 | +// `projects/packages/videopress/src/dashboard/admin-shell.scss`). |
| 20 | +// Without this, JetpackFooter scrolls with the body when the activity |
| 21 | +// list grows past the viewport. Scoped to the backup admin body so it |
| 22 | +// can't leak onto other Jetpack pages. |
| 23 | +body.jetpack_page_jetpack-backup { |
| 24 | + @include jetpack-admin-page-layout-wp-build; |
| 25 | + |
| 26 | + // The shared mixin assumes `<AdminPage>` from `@automattic/jetpack-components` |
| 27 | + // (which stamps `.jp-admin-page` AND admin-ui's `.admin-ui-page` / |
| 28 | + // `.admin-ui-page__header` classes verbatim). Our DashboardLayout uses |
| 29 | + // `<Page>` from `@wordpress/admin-ui` 2.x, whose root + header classes |
| 30 | + // are emotion-hashed (`_<hash>__page`, `_<hash>__header`) and don't |
| 31 | + // match the mixin's selectors. We add `.jp-admin-page` to the Page so |
| 32 | + // the mixin's outer flex chain still attaches, and reproduce the |
| 33 | + // page-internal "header / middle / footer" sticky layout here using |
| 34 | + // our own stable class names (`.jpb-dev-mode-banner`, |
| 35 | + // `.jpb-dashboard-body`, `.jetpack-footer`). |
| 36 | + .jp-admin-page { |
| 37 | + |
| 38 | + > header { |
| 39 | + flex-shrink: 0; |
| 40 | + } |
| 41 | + |
| 42 | + > .jpb-dev-mode-banner { |
| 43 | + flex-shrink: 0; |
| 44 | + } |
| 45 | + |
| 46 | + > .jpb-dashboard-body { |
| 47 | + flex: 1 1 auto; |
| 48 | + min-height: 0; |
| 49 | + overflow: auto; |
| 50 | + } |
| 51 | + |
| 52 | + > .jetpack-footer { |
| 53 | + flex-shrink: 0; |
| 54 | + } |
| 55 | + } |
| 56 | +} |
5 | 57 |
|
6 | 58 | .jpb-overview { |
7 | 59 | display: grid; |
|
0 commit comments