Hello Dolly: normalize centrally, drop per-page duplicates#48472
Conversation
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! Boost plugin: No scheduled milestone found for this plugin. If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. |
Code Coverage SummaryThis PR did not change code coverage! That could be good or bad, depending on the situation. Everything covered before, and still is? Great! Nothing was covered before? Not so great. 🤷 |
|
|
||
| // We deliberately do NOT set `position`/`top`/`left`/`right` here: | ||
| // those would become active on any per-page rule that flips Dolly to | ||
| // `position: absolute` (e.g. My Jetpack), causing it to stretch to its |
There was a problem hiding this comment.
Do we necessarily need those My Jetpack custom styles for this or can it also share what we have here?
There was a problem hiding this comment.
It's indended, My Jetpack page is gonna be either migrated to use AdminPage (and the mixin) or deleted, but it's a follow up I'll be dealing with next
| float: none; | ||
| padding: 10px; | ||
| text-align: right; | ||
| background: #fff; |
There was a problem hiding this comment.
Let's use the color variable of the header here?
| font-size: 12px; | ||
| font-style: italic; |
There was a problem hiding this comment.
These seem reduntant as they're already in Hello Dolly.
| background: #fff; | ||
| font-size: 12px; | ||
| font-style: italic; | ||
| color: #87a6bc; |
The AdminPage mixin already shipped a partial Hello Dolly normalize rule
(`background-color: #fff` only, anchored on the `jetpack-admin-page` body
class). Expand it to the full visual treatment so individual plugin
dashboards don't need their own per-page overrides.
What's covered by the centralized rule now:
- float: none (break out of Hello Dolly's default float: right)
- padding 10px, white background
- italic, gray text (#87a6bc), right-aligned
- border-bottom: none
- hidden under 660px
We deliberately do NOT set position/top/left/right offsets in the central
rule — those would become active on any per-page rule that flips Dolly to
position: absolute (e.g. My Jetpack), causing it to stretch full-width and
pin to top, covering the page title.
Per-page rules removed (their content is a subset of the central rule):
- plugins/boost: `.jetpack_page_jetpack-boost #dolly { background: #fff }`
- packages/newsletter: `.jetpack_page_jetpack-newsletter #dolly { width: 100%; text-align: right }`
The broad rules in `plugins/jetpack/_inc/client/scss/shared/_main.scss`
(`.jetpack-pagestyles #dolly`) and `admin-static.scss`
(`.wp-admin #dolly`) are intentionally left in place — they cover pages
that load Jetpack's main admin CSS bundle but not the AdminPage component
CSS (e.g. the React Settings/Dashboard via wrap_ui).
My Jetpack's own `position: absolute` rule is unaffected; it composes
cleanly with the central rule now that no inert position offsets are set.
Address review feedback on the centralized normalize rule: - Drop `font-size: 12px` and `padding: 10px` — Hello Dolly already sets `font-size: 12px` and `padding: 5px 10px` (close enough to ours). Letting Hello Dolly's defaults stand keeps our rule focused on the bits we actually need to differ. - Switch hardcoded `#fff` and `#87a6bc` to WPDS design tokens (`--wpds-color-bg-surface-neutral-strong` and `--wpds-color-fg-content-neutral-weak`) with the original hex as `var()` fallback. Falls back to the previous look until the tokens resolve at body level (admin-ui's ThemeProvider scope), then auto- tracks the surrounding page chrome. Italic stays — not in Hello Dolly defaults, but a Jetpack-side decoration for the song-lyric vibe. Out-of-scope per the review.
982830a to
b360c03
Compare
Part of #49285.
Rebased on trunk. The two PRs this was stacked behind — #48410 (admin-ui 2.0.0) and companion #48471 (AI page mixin) — have both merged, so this is ready for review.
Proposed changes
The AdminPage mixin already shipped a partial Hello Dolly normalize rule (just
background-color: #fff, anchored on thejetpack-admin-pagebody class added server-side by Jetpack's admin menu registration). This PR expands it to the full visual treatment so individual plugin dashboards no longer need per-page overrides.js-packages/components/components/admin-page/style.module.scss: expand:global(.jetpack-admin-page #dolly)from one line (background-color: #fff) to the full normalize set:float: none(break out of Hello Dolly's defaultfloat: right)padding: 10px,background: #fffitalic,color: #87a6bc,text-align: rightborder-bottom: none<660pxplugins/boost/app/assets/src/css/main/wp-admin.scss: remove.jetpack_page_jetpack-boost #dolly { background: #fff }(covered by the central rule now).packages/newsletter/src/settings/style.scss: remove.jetpack_page_jetpack-newsletter #dolly { width: 100%; text-align: right }(covered by the central rule now).The broad rules in
plugins/jetpack/_inc/client/scss/shared/_main.scss(.jetpack-pagestyles #dolly) andadmin-static.scss(.wp-admin #dolly) are intentionally left in place — they cover pages that load Jetpack's main admin CSS bundle but not the AdminPage component CSS (e.g. the React Settings/Dashboard pages viawrap_ui).Why no
position/top/left/rightin the central ruleInert offsets like
position: relative; left: 0; right: 0; top: 0;on a normal-flow<p>element do nothing visible. But they become active on any per-page rule that flips Dolly toposition: absolute(e.g. My Jetpack'sbody.jetpack_page_my-jetpack p#dolly { position: absolute; inset-inline-end: 0; z-index: 2 }). Combined with the offsets, Dolly stretches to the full container width and pins to top, covering the page title. We tested this — see screenshots. The central rule deliberately omits those properties so My Jetpack's absolute-position rule composes cleanly.Related product discussion/links
visualprop for Jetpack logo #48410 (admin-ui 2.0.0) — merged. This PR was stacked behind it.Does this pull request change what data or activity we track or use?
No
Testing instructions
Hard-refresh wp-admin and visit:
?page=my-jetpack): Dolly should appear at top-right corner via My Jetpack'sposition: absoluterule, not as a full-width strip covering the page title.?page=jetpack-boost): Dolly normalized — italic, gray, right-aligned, white bg.?page=jetpack-newsletter): same — italic, gray, right-aligned, white bg.?page=ai): Dolly normalized.Screenshots
🤖 Generated with Claude Code