| 1 |
/** |
| 2 |
* OpenStation — Recycle Bin window styles. |
| 3 |
* |
| 4 |
* Scoped to `.desktop-mode-recycle-bin` so the rules can't leak into other |
| 5 |
* windows. Layout: a sticky toolbar across the top, then a flex-1 |
| 6 |
* body that hosts a `<os-table>`. The table is told to size to the |
| 7 |
* body via `--os-ui-table-max-height: 100%` so its sticky header |
| 8 |
* engages. |
| 9 |
*/ |
| 10 |
|
| 11 |
.desktop-mode-recycle-bin { |
| 12 |
display: flex; |
| 13 |
flex-direction: column; |
| 14 |
height: 100%; |
| 15 |
width: 100%; |
| 16 |
background: var( --os-ui-surface, #fff ); |
| 17 |
color: var( --os-ui-fg, #1d2327 ); |
| 18 |
} |
| 19 |
|
| 20 |
.os-recycle-bin__toolbar { |
| 21 |
display: flex; |
| 22 |
flex-wrap: wrap; |
| 23 |
align-items: center; |
| 24 |
gap: 12px; |
| 25 |
padding: 10px 14px; |
| 26 |
border-bottom: 1px solid var( --os-ui-border, rgba( 0, 0, 0, 0.08 ) ); |
| 27 |
background: var( --os-ui-surface-elevated, #f6f7f7 ); |
| 28 |
} |
| 29 |
|
| 30 |
.os-recycle-bin__toolbar-left, |
| 31 |
.os-recycle-bin__toolbar-right, |
| 32 |
.os-recycle-bin__toolbar-trailing { |
| 33 |
display: flex; |
| 34 |
align-items: center; |
| 35 |
gap: 8px; |
| 36 |
} |
| 37 |
|
| 38 |
/* |
| 39 |
* Honour the `hidden` attribute. The browser's UA stylesheet |
| 40 |
* sets `[hidden] { display: none }`, but our explicit |
| 41 |
* `display: flex` above wins on specificity. These rules restore |
| 42 |
* the expected behaviour for the two groups the JS hides: the bulk |
| 43 |
* actions (nothing selected) and the whole toolbar (nothing in the |
| 44 |
* bin). `<os-empty-state>` handles its own. |
| 45 |
*/ |
| 46 |
.os-recycle-bin__toolbar[hidden], |
| 47 |
.os-recycle-bin__toolbar-right[hidden] { |
| 48 |
display: none; |
| 49 |
} |
| 50 |
|
| 51 |
.os-recycle-bin__toolbar-trailing { |
| 52 |
margin-inline-start: auto; |
| 53 |
} |
| 54 |
|
| 55 |
.os-recycle-bin__count { |
| 56 |
font-size: 12px; |
| 57 |
font-weight: 600; |
| 58 |
color: var( --os-ui-fg-muted, #50575e ); |
| 59 |
font-variant-numeric: tabular-nums; |
| 60 |
padding-inline-end: 4px; |
| 61 |
} |
| 62 |
|
| 63 |
.os-recycle-bin__body { |
| 64 |
flex: 1 1 auto; |
| 65 |
min-height: 0; |
| 66 |
display: flex; |
| 67 |
padding: 8px 12px 12px; |
| 68 |
} |
| 69 |
|
| 70 |
.os-recycle-bin__body os-table { |
| 71 |
flex: 1 1 auto; |
| 72 |
/* |
| 73 |
* A flex item's minimum size is its content's, and this content |
| 74 |
* is a table whose columns refuse to wrap: without the 0 the |
| 75 |
* table grows past the body, the body (which does not scroll) |
| 76 |
* clips it, and the table's own scroller — the one thing that can |
| 77 |
* scroll sideways — never overflows. This is what made a long |
| 78 |
* title unreachable in a narrow window. |
| 79 |
*/ |
| 80 |
min-inline-size: 0; |
| 81 |
--os-ui-table-max-height: 100%; |
| 82 |
} |
| 83 |
|
| 84 |
/* |
| 85 |
* A narrow window — a phone, or a desktop window pulled in. The |
| 86 |
* toolbar's three groups each take a whole row instead of sharing |
| 87 |
* one: the type filter scrolls sideways under the search, the |
| 88 |
* selection actions share their row, and Empty Trash keeps the last |
| 89 |
* row's end. Nothing overflows the window's edge. The container is |
| 90 |
* the app root (`.os-app`, `app-runtime.css`). |
| 91 |
*/ |
| 92 |
@container ( max-width: 560px ) { |
| 93 |
.os-recycle-bin__toolbar { |
| 94 |
gap: 8px; |
| 95 |
padding: 8px 10px; |
| 96 |
} |
| 97 |
|
| 98 |
.os-recycle-bin__toolbar-left, |
| 99 |
.os-recycle-bin__toolbar-right, |
| 100 |
.os-recycle-bin__toolbar-trailing { |
| 101 |
flex: 1 1 100%; |
| 102 |
min-inline-size: 0; |
| 103 |
} |
| 104 |
|
| 105 |
.os-recycle-bin__toolbar-left { |
| 106 |
flex-wrap: wrap; |
| 107 |
} |
| 108 |
|
| 109 |
.os-recycle-bin__toolbar-left os-segmented { |
| 110 |
flex: 1 1 100%; |
| 111 |
max-inline-size: 100%; |
| 112 |
overflow-x: auto; |
| 113 |
scrollbar-width: none; |
| 114 |
} |
| 115 |
|
| 116 |
.os-recycle-bin__toolbar-left os-text-field { |
| 117 |
flex: 1 1 100%; |
| 118 |
} |
| 119 |
|
| 120 |
.os-recycle-bin__toolbar-right { |
| 121 |
flex-wrap: wrap; |
| 122 |
} |
| 123 |
|
| 124 |
.os-recycle-bin__toolbar-right os-button { |
| 125 |
flex: 1 1 auto; |
| 126 |
} |
| 127 |
|
| 128 |
.os-recycle-bin__count { |
| 129 |
flex: 1 1 100%; |
| 130 |
} |
| 131 |
|
| 132 |
.os-recycle-bin__toolbar-trailing { |
| 133 |
margin-inline-start: 0; |
| 134 |
justify-content: flex-end; |
| 135 |
} |
| 136 |
|
| 137 |
.os-recycle-bin__body { |
| 138 |
padding: 6px 8px 8px; |
| 139 |
} |
| 140 |
} |
| 141 |
|
| 142 |
/* |
| 143 |
* The phone (the shell's mode stamp, at any width). The list is a |
| 144 |
* card per row (`<os-table stacked>`, set by the app) running edge to |
| 145 |
* edge; the search leads the toolbar, with the type chips scrolling |
| 146 |
* under it; and the selection's actions are a bar along the bottom |
| 147 |
* of the window, under the thumb, instead of a row in the toolbar |
| 148 |
* the list has scrolled away from. The bar is a flex sibling of the |
| 149 |
* body, so the cards end where it begins. |
| 150 |
*/ |
| 151 |
html[data-os-mode="mobile"] .os-recycle-bin__toolbar { |
| 152 |
gap: 8px; |
| 153 |
padding: 8px 10px; |
| 154 |
} |
| 155 |
|
| 156 |
html[data-os-mode="mobile"] .os-recycle-bin__toolbar-left, |
| 157 |
html[data-os-mode="mobile"] .os-recycle-bin__toolbar-trailing { |
| 158 |
flex: 1 1 100%; |
| 159 |
min-inline-size: 0; |
| 160 |
} |
| 161 |
|
| 162 |
html[data-os-mode="mobile"] .os-recycle-bin__toolbar-left { |
| 163 |
flex-wrap: wrap; |
| 164 |
} |
| 165 |
|
| 166 |
html[data-os-mode="mobile"] .os-recycle-bin__toolbar-left os-text-field { |
| 167 |
order: -1; |
| 168 |
flex: 1 1 100%; |
| 169 |
} |
| 170 |
|
| 171 |
html[data-os-mode="mobile"] .os-recycle-bin__toolbar-left os-segmented { |
| 172 |
flex: 1 1 100%; |
| 173 |
max-inline-size: 100%; |
| 174 |
overflow-x: auto; |
| 175 |
scrollbar-width: none; |
| 176 |
} |
| 177 |
|
| 178 |
html[data-os-mode="mobile"] .os-recycle-bin__toolbar-trailing { |
| 179 |
margin-inline-start: 0; |
| 180 |
justify-content: flex-end; |
| 181 |
} |
| 182 |
|
| 183 |
html[data-os-mode="mobile"] .os-recycle-bin__body { |
| 184 |
padding: 0; |
| 185 |
} |
| 186 |
|
| 187 |
.os-recycle-bin__bulk { |
| 188 |
display: flex; |
| 189 |
flex-wrap: wrap; |
| 190 |
align-items: center; |
| 191 |
gap: 8px; |
| 192 |
padding: 10px 12px calc( 10px + env( safe-area-inset-bottom, 0px ) ); |
| 193 |
border-block-start: 1px solid var( --os-ui-border, rgba( 0, 0, 0, 0.08 ) ); |
| 194 |
background: var( --os-ui-surface-elevated, #f6f7f7 ); |
| 195 |
box-shadow: 0 -6px 18px rgba( 0, 0, 0, 0.06 ); |
| 196 |
} |
| 197 |
|
| 198 |
.os-recycle-bin__bulk[hidden] { |
| 199 |
display: none; |
| 200 |
} |
| 201 |
|
| 202 |
.os-recycle-bin__bulk .os-recycle-bin__count { |
| 203 |
flex: 1 1 100%; |
| 204 |
padding-inline-end: 0; |
| 205 |
} |
| 206 |
|
| 207 |
.os-recycle-bin__bulk os-button { |
| 208 |
flex: 1 1 auto; |
| 209 |
} |
| 210 |
|
| 211 |
/* |
| 212 |
* NOTE — cell-content styles are now inlined in `src/recycle-bin/ |
| 213 |
* index.ts`. `<os-table>` renders into its own shadow DOM, which |
| 214 |
* blocks document-level stylesheets (and Dashicons) from reaching |
| 215 |
* any node we return from a `column.render` callback. The empty- |
| 216 |
* state, toolbar, and body styles below remain CSS because they |
| 217 |
* live in the bin window's light-DOM template. |
| 218 |
*/ |
| 219 |
|
| 220 |
/* `<os-empty-state>` centres its own contents; this makes it fill |
| 221 |
* the body once the table beside it is hidden. */ |
| 222 |
.os-recycle-bin__body os-empty-state { |
| 223 |
flex: 1 1 auto; |
| 224 |
} |
| 225 |
|
| 226 |
/* |
| 227 |
* Drop-target highlight for cross-window drag-to-trash. Set when |
| 228 |
* the desktop drag handler hit-tests the cursor over the bin's |
| 229 |
* root via `data-os-trash-drop-active`. Returns to |
| 230 |
* normal on pointer-up or when the cursor leaves the window. |
| 231 |
*/ |
| 232 |
.desktop-mode-recycle-bin[ data-os-trash-drop-active ] { |
| 233 |
position: relative; |
| 234 |
box-shadow: inset 0 0 0 2px var( --wp-admin-theme-color, #2271b1 ); |
| 235 |
transition: box-shadow 80ms ease; |
| 236 |
} |
| 237 |
|
| 238 |
/* Dock-icon variant: when the recycle-bin window is closed, the |
| 239 |
* desktop drag handler highlights the dock tile instead. Same |
| 240 |
* affordance — outline + faint tint — so the user reads the icon |
| 241 |
* as a valid drop target without needing to open the window |
| 242 |
* first. The selector matches the dock tile's `data-system-id` |
| 243 |
* so this CSS applies wherever the recycle-bin dock entry |
| 244 |
* renders (left rail, bottom rail, future placements). */ |
| 245 |
.os-dock__item[ data-system-id="desktop-mode-recycle-bin" ][ data-os-trash-drop-active ] { |
| 246 |
outline: 2px solid var( --wp-admin-theme-color, #2271b1 ); |
| 247 |
outline-offset: 2px; |
| 248 |
border-radius: 12px; |
| 249 |
background: color-mix( |
| 250 |
in srgb, |
| 251 |
var( --wp-admin-theme-color, #2271b1 ) 14%, |
| 252 |
transparent |
| 253 |
); |
| 254 |
transition: |
| 255 |
outline-color 80ms ease, |
| 256 |
background 80ms ease; |
| 257 |
} |
| 258 |
|
| 259 |
.desktop-mode-recycle-bin[ data-os-trash-drop-active ]::before { |
| 260 |
content: ''; |
| 261 |
position: absolute; |
| 262 |
inset: 0; |
| 263 |
pointer-events: none; |
| 264 |
background: color-mix( |
| 265 |
in srgb, |
| 266 |
var( --wp-admin-theme-color, #2271b1 ) 8%, |
| 267 |
transparent |
| 268 |
); |
| 269 |
z-index: 1; |
| 270 |
} |
| 271 |
|
| 272 |
.desktop-mode-recycle-bin[ data-os-trash-drop-active ]::after { |
| 273 |
content: '🗑 Drop to move to Trash'; |
| 274 |
position: absolute; |
| 275 |
left: 50%; |
| 276 |
top: 50%; |
| 277 |
transform: translate( -50%, -50% ); |
| 278 |
padding: 10px 18px; |
| 279 |
border-radius: 999px; |
| 280 |
background: var( --wp-admin-theme-color, #2271b1 ); |
| 281 |
color: var( --os-ui-fg-on-accent, #fff ); |
| 282 |
font-weight: 600; |
| 283 |
font-size: 13px; |
| 284 |
letter-spacing: 0.2px; |
| 285 |
box-shadow: 0 8px 24px rgba( 0, 0, 0, 0.18 ); |
| 286 |
pointer-events: none; |
| 287 |
z-index: 2; |
| 288 |
} |
| 289 |
|