From d5cb476e2c78b1dabee726461fe237544e002383 Mon Sep 17 00:00:00 2001 From: Philip Jackson Date: Tue, 30 Jun 2026 13:17:22 +1200 Subject: [PATCH] Help Center: align/size admin-bar Help icon consistently Port wp-calypso#111737: tweak SVG viewBox (desktop values in markup) and scale down at <=782px to reproduce the mobile viewBox. Concentric viewBoxes make a centered CSS scale exact, so no markup/ID changes or JS. --- .../changelog/fix-mu-wpcom-help-center-icon-sizing | 4 ++++ .../src/features/help-center/class-help-center.php | 12 ++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 projects/packages/jetpack-mu-wpcom/changelog/fix-mu-wpcom-help-center-icon-sizing diff --git a/projects/packages/jetpack-mu-wpcom/changelog/fix-mu-wpcom-help-center-icon-sizing b/projects/packages/jetpack-mu-wpcom/changelog/fix-mu-wpcom-help-center-icon-sizing new file mode 100644 index 000000000000..99e081087788 --- /dev/null +++ b/projects/packages/jetpack-mu-wpcom/changelog/fix-mu-wpcom-help-center-icon-sizing @@ -0,0 +1,4 @@ +Significance: patch +Type: fixed + +Help Center: align and size the admin-bar Help icon consistently across viewports diff --git a/projects/packages/jetpack-mu-wpcom/src/features/help-center/class-help-center.php b/projects/packages/jetpack-mu-wpcom/src/features/help-center/class-help-center.php index 8a405d358700..72f473e774c7 100644 --- a/projects/packages/jetpack-mu-wpcom/src/features/help-center/class-help-center.php +++ b/projects/packages/jetpack-mu-wpcom/src/features/help-center/class-help-center.php @@ -201,10 +201,10 @@ function ( $wp_admin_bar ) { $wp_admin_bar->add_menu( array( 'id' => 'help-center', - 'title' => ' + 'title' => ' - + @@ -264,6 +264,14 @@ function ( $wp_admin_bar ) { $version ); + // The admin-bar Help Center icons carry their desktop viewBox in markup so the glyph + // aligns/sizes consistently with the other icons. The desktop and mobile viewBoxes are + // concentric, so the mobile appearance is reproduced by scaling about the icon's centre. + wp_add_inline_style( + 'help-center-' . $variant . '-style', + '@media (max-width:782px){#help-center-icon{transform:scale(0.875)}#help-center-icon-with-notification{transform:scale(0.8667)}}' + ); + // In the block editor the Help Center is already present in the editor toolbar // via SlotFill at viewports >= 600px. Hide the admin bar item at those widths // to avoid showing it in two places; keep it visible on mobile where the admin