CRM: Align admin footer with the unified Jetpack footer - #8
Conversation
9a93f38 to
211ee90
Compare
| * | ||
| * Restyles WordPress' #wpfooter on CRM admin pages to match the unified Jetpack | ||
| * admin-page footer: Jetpack logo + wordmark on the left, Automattic "by line" | ||
| * on the right. The footer contents are injected via the `admin_footer_text` |
| margin-inline-start: auto; | ||
| } | ||
|
|
||
| .clear { |
There was a problem hiding this comment.
Do we really need to do this? I don't see a element with a clear class that was added.
There was a problem hiding this comment.
Keen eye! If it stays visible, it becomes a trailing flex item and the gap pushes the Automattic byline 24px off the right edge. So the rule is doing real work.
There was a problem hiding this comment.
Added a comment to make it clear, but we can remove that as well
|
I had a read through Three of the token names don't exist:
I checked against the Two of the three render the same either way,
Two more where the token does resolve and the fallback is just dead:
Nothing renders wrong there, the values never get used. Worth matching them up so nobody reads 16px and believes it. The comment at The block itself is fine and I'd keep it. Core hides the footer below 783px (
No media query, and a specificity of (1,2,1) against core's (1,0,0), so So five token names and one comment. Shout if I've read the specificity wrong. |
Oh boy, welcome to the madness. We've recenlty had a monorepo update and that go mixed with a var rename of the design tokens. So I triggered a replacement sweep and eventually got it merged into the update. Let me dig deeper, but I'm not liking this already |
Swap the WP admin footer content on CRM pages from the "Thank you for using Jetpack CRM" / version-string credits to the unified Jetpack admin footer: a Jetpack logo + "Jetpack" wordmark on the left (via admin_footer_text) and the Automattic "by line" on the right (via update_footer). Existing gating is preserved unchanged -- only rendered on CRM admin pages, only when the "Show admin credits" setting is on, and wrapped in ##WLREMOVE so it is stripped from white-label builds. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add an emerald SCSS partial that restyles #wpfooter on CRM admin pages to match the unified Jetpack admin-page footer: top border, #fcfcfc surface, flex layout with the logo on the left and the Automattic by line pushed to the right. Scoped to body.jpcrm-admin and guarded with :has(.jetpack-footer__logo) so the styling only applies when the branded footer content is present (e.g. not when credits are disabled or under white label). WPDS design tokens are referenced with hardcoded fallbacks, mirroring the top menu partial. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Two mobile issues on CRM admin pages: - WordPress moves the admin menu off-canvas on small screens, but on CRM's non-fluid pages it can leave the desktop left margin on #wpfooter, so the footer was indented from the screen edge. Reset the margin to 0 at <=782px (where the menu is off-canvas, so it is safe) to sit flush left. - The unified Jetpack footer stacks its rows left-aligned on mobile, but it wraps naturally because of its middle nav links. The CRM footer only has the logo and the Automattic by line, so it never wrapped -- the by line stayed on the same row, pushed to the far edge. Stack the two explicitly at <=480px onto their own left-aligned rows. Desktop keeps the single-row layout with the by line pushed right, and the footer still clears the admin menu. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Drop the file header comment block. - Remove the #wpfooter p reset: WordPress already sets margin/padding to 0 on #wpfooter p, and flexbox neutralizes float on flex items, so the only live declaration was a minor line-height tweak that we don't need. - Keep the .clear rule but document why: WordPress core outputs an empty <div class="clear"> inside #wpfooter, which as a flex item would add a trailing gap and push the Automattic by line off the right edge. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The footer partial was authored against the renamed (long-form) WPDS token names — background-*/foreground-* — which only exist in @wordpress/theme 1.x. This repo ships 0.13.0, whose tokens use the old short names (bg-*/fg-*), so every footer token silently fell back to its hardcoded value. One of those fallbacks was wrong (#646970 vs #707070), leaving the Automattic byline the wrong grey. - Point the three renamed color tokens at the short name that resolves today, with the long name as a second var() fallback so they keep tracking WPDS after the eventual bump to @wordpress/theme 1.x, then the hardcoded value as a last resort. - foreground-neutral-strong was an invented name (exists in neither naming); use fg-content-neutral, the real #1e1e1e token. - Correct the dead fallbacks on the two non-renamed tokens (stroke-surface-neutral-weak #e4e4e4, padding-xl 20px) to match the shipped values so they no longer mislead. - Rewrite the mobile comment: the indent core leaves is the 36px .auto-fold icon-menu margin, not the desktop margin, and note why the mobile rules are reachable despite core hiding #wpfooter below 782px. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Dug into the token issue @donnchawp raised — good catch, and there's a wrinkle worth recording. The rename went the other way. The WPDS tokens were renamed short → long ( So @donnchawp's recommended renames were right for what we ship — I just corrected the reasoning. Fixed in df8dcb9 (footer partial only):
Follow-up (separate PR): bump |
3174634 to
df8dcb9
Compare
The admin footer no longer prints "Powered by Jetpack CRM" - it shows the Jetpack logo and the Automattic byline. Describe what the setting actually does now.
Fixes JETPACK-1508
Summary
Aligns the Jetpack CRM admin footer with the unified Jetpack admin-page footer used across the other Jetpack products, following the same pure-PHP/CSS approach as the header work in jetpack#47871. This standalone repo doesn't ship
@automattic/jetpack-components, so the ReactJetpackFootercomponent isn't available. The look is reproduced with PHP markup and SCSS instead.Before: "Thank you for using Jetpack CRM." + "Jetpack CRM v6.8.1"

After: Jetpack logo + "Jetpack" (left) · Automattic "An Automattic Airline" byline (right)


Changes
includes/ZeroBSCRM.AdminStyling.php— swap the two footer filters' output to the Jetpack logo (left) and Automattic byline (right).sass/emerald/_jpcrm_footer.scss(new) — restyle#wpfooteron CRM pages: top border,#fcfcfcsurface, flex layout, byline pushed right. WPDS tokens with hardcoded fallbacks, mirroring_jpcrm_top_menu.scss. Three of them are written asvar(--short, var(--long, #hex))because this repo still pins@wordpress/theme@0.13.0, which only defines the short-form names. They pick up the long-form names automatically once Bump @wordpress/theme to 1.x and migrate to renamed WPDS token names #13 bumps the package.sass/jpcrm-emerald.scss—@usethe new partial.admin/settings/general.page.php— the "Show admin credits" description promised "Powered by Jetpack CRM" footers. It doesn't do that any more, so it now describes the Jetpack and Automattic logos.Gating (unchanged)
All the existing conditions are preserved. The footer renders only on CRM admin pages, and only when the "Show admin credits" setting (
showpoweredby_admin) is on. The branding sits inside##WLREMOVEblocks so it's stripped from white-label builds.To be clear about where that happens: nothing in this repo strips the markers.
scripts/build-plugin.shleaves them alone, and the stripping is done by the white-label pipeline outside this repo. So it can't be verified by runningmake releasehere.The SCSS is guarded with
#wpfooter:has(.jetpack-footer__logo)so no border or surface is drawn when the footer is empty (credits off, or white label).Two deliberate behaviour changes
update_footerstill runs at priority 11, so the WordPress version stays suppressed on CRM pages as before. The plugin version is still on the Plugins screen.#wpfooterat that width; the new base rule outranks it. This is what the unified footer does, so it's intentional, but it isn't obvious from the diff.Testing
#fcfcfcsurface, computed values matching the real My Jetpack footer).##WLREMOVEblock. The footer renders empty with no Jetpack/Automattic branding leak and no orphaned styling, the header correctly falls back (no "CRM" text), andphp -lis clean on the stripped file.Note: the compiled CSS under
css/is gitignored in this repo, so this PR is source-only. The SCSS is compiled at build/release time.🤖 Generated with Claude Code