Skip to content

Commit 488310b

Browse files
committed
Add an adjustable window size
1 parent 05c5a23 commit 488310b

3 files changed

Lines changed: 374 additions & 68 deletions

File tree

src/wp-admin/css/on-this-day.css

Lines changed: 53 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@
77
3. Widget title date pill (`.hndle::after`)
88
4. Timeline (year headers, vertical line, post rows)
99
5. Post row (icon circle, title, excerpt, meta row)
10-
6. Empty state
11-
7. Adaptive rules (reduced motion, small viewports)
10+
6. Window control
11+
7. Empty state
12+
8. Adaptive rules (reduced motion, small viewports)
1213
============================================================================= */
1314

1415
/* -----------------------------------------------------------------------------
@@ -50,11 +51,16 @@
5051
2. Postbox chrome
5152
----------------------------------------------------------------------------- */
5253
#dashboard_on_this_day {
54+
/* To honour the postbox border-radius. */
55+
overflow: hidden;
56+
5357
& .inside {
5458
margin: 0;
5559
padding: 0;
5660
max-height: 560px;
57-
overflow: auto;
61+
display: flex;
62+
flex-direction: column;
63+
overflow: hidden;
5864
}
5965

6066
& .hndle {
@@ -63,11 +69,23 @@
6369
}
6470

6571
.on-this-day-widget {
72+
display: flex;
73+
flex-direction: column;
74+
flex: 1 1 auto;
75+
min-height: 0;
6676
font-size: 13px;
6777
color: var(--otd-ink);
6878
line-height: 1.5;
6979
}
7080

81+
/* Scrollable content area — keeps the timeline / empty state contained
82+
so the window control below pins to the bottom of the postbox body. */
83+
.on-this-day-scroll {
84+
flex: 1 1 auto;
85+
min-height: 0;
86+
overflow: auto;
87+
}
88+
7189
/* -----------------------------------------------------------------------------
7290
3. Widget title date pill
7391
@@ -282,7 +300,37 @@
282300
}
283301

284302
/* -----------------------------------------------------------------------------
285-
6. Empty state
303+
6. Window control
304+
----------------------------------------------------------------------------- */
305+
.on-this-day-window-form {
306+
flex: 0 0 auto;
307+
padding: 12px 20px 14px;
308+
border-top: 1px solid var(--otd-line);
309+
background: #fff;
310+
}
311+
312+
.on-this-day-window-control {
313+
display: grid;
314+
grid-template-columns: auto minmax(120px, 1fr) auto;
315+
align-items: center;
316+
gap: 8px;
317+
}
318+
319+
.on-this-day-window-control input[type="range"] {
320+
width: 100%;
321+
margin: 0;
322+
accent-color: var(--otd-accent);
323+
}
324+
325+
.on-this-day-window-scale {
326+
color: var(--otd-subtle);
327+
font-size: 11px;
328+
line-height: 1.4;
329+
white-space: nowrap;
330+
}
331+
332+
/* -----------------------------------------------------------------------------
333+
7. Empty state
286334
----------------------------------------------------------------------------- */
287335
.on-this-day-empty {
288336
text-align: center;
@@ -321,7 +369,7 @@
321369
}
322370

323371
/* -----------------------------------------------------------------------------
324-
7. Adaptive rules
372+
8. Adaptive rules
325373
----------------------------------------------------------------------------- */
326374
@media (prefers-reduced-motion: reduce) {
327375
.on-this-day-post-title a,

0 commit comments

Comments
 (0)