| 1 |
/* -------------------------------------------------------------------------- |
| 2 |
Page header (wpsubs-page-header) |
| 3 |
|
| 4 |
The standard top-of-page block shared by every admin screen: a title, an |
| 5 |
optional one-line description, an optional right-aligned action slot, and a |
| 6 |
dashed rule beneath. Render it with wpsubs_render_page_header() so the title, |
| 7 |
description and rule stay identical across pages and on new ones. |
| 8 |
|
| 9 |
Markup: |
| 10 |
<div class="wpsubs-page-header"> |
| 11 |
<div class="wpsubs-page-header__row"> |
| 12 |
<div class="wpsubs-page-header__text"> |
| 13 |
<h1 class="wpsubs-page-header__title">Title</h1> |
| 14 |
<p class="wpsubs-page-header__desc">Description</p> |
| 15 |
</div> |
| 16 |
<div class="wpsubs-page-header__actions">…</div> |
| 17 |
</div> |
| 18 |
<div class="wpsubs-page-header__rule"></div> |
| 19 |
</div> |
| 20 |
-------------------------------------------------------------------------- */ |
| 21 |
.wpsubs-page-header { |
| 22 |
margin-bottom: 20px; |
| 23 |
} |
| 24 |
|
| 25 |
/* With an aside (e.g. stat cards), the header and the aside sit side by side. */ |
| 26 |
.wpsubs-page-header--has-aside { |
| 27 |
display: flex; |
| 28 |
align-items: flex-start; |
| 29 |
gap: 24px; |
| 30 |
flex-wrap: wrap; |
| 31 |
} |
| 32 |
.wpsubs-page-header--has-aside .wpsubs-page-header__main { |
| 33 |
flex: 1 1 auto; |
| 34 |
min-width: 240px; |
| 35 |
} |
| 36 |
.wpsubs-page-header__aside { |
| 37 |
flex: 0 0 auto; |
| 38 |
display: flex; |
| 39 |
gap: 12px; |
| 40 |
flex-wrap: wrap; |
| 41 |
} |
| 42 |
|
| 43 |
/* Title row: the title on the left, a spacer, then any action buttons pushed to |
| 44 |
the right — all on one line. The description sits full-width below it. */ |
| 45 |
.wpsubs-page-header__row { |
| 46 |
display: flex; |
| 47 |
align-items: center; |
| 48 |
gap: 10px; |
| 49 |
margin: 0 0 6px; |
| 50 |
} |
| 51 |
|
| 52 |
/* WordPress admin core styles h1/p elements, so these need !important to win |
| 53 |
the way the original inline styles did. */ |
| 54 |
.wpsubs-page-header__title { |
| 55 |
font-size: 1.375rem !important; |
| 56 |
font-weight: 700 !important; |
| 57 |
color: var(--wpsubs-text, #374151) !important; |
| 58 |
margin: 0 !important; |
| 59 |
padding: 0 !important; |
| 60 |
line-height: 1.2 !important; |
| 61 |
} |
| 62 |
|
| 63 |
.wpsubs-page-header__desc { |
| 64 |
font-size: 13px !important; |
| 65 |
color: var(--wpsubs-text-muted, #6b7280) !important; |
| 66 |
margin: 0 0 12px !important; |
| 67 |
line-height: 1.5 !important; |
| 68 |
} |
| 69 |
|
| 70 |
/* No description under the title: the row keeps the gap to the rule instead. */ |
| 71 |
.wpsubs-page-header__row:not(:has(+ .wpsubs-page-header__desc)) { |
| 72 |
margin-bottom: 12px; |
| 73 |
} |
| 74 |
|
| 75 |
.wpsubs-page-header__rule { |
| 76 |
border-top: 1px dashed var(--wpsubs-border-strong, #d0d3d7); |
| 77 |
} |
| 78 |
|