Inconsistent Admin Bar module styling between themes
Bug Description
The content displayed in Site Kit's admin bar varies in appearance when different themes are activated:
Twenty Nineteen

Twenty Twenty

This appears to be due to different relative font-size values applied to the <html> element by each theme. This value should be fixed on the admin bar app's element so that it doesn't inherit this relative sizing.
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
- Ensure that font sizing in the Site Kit admin bar menu content with the stats is consistent regardless of the theme currently used.
Implementation Brief
The problem is that the styles use rem units which are specifically relative to the value defined on the <html> element which often varies from theme to theme.
These are generally the right unit to use, but in our case we need our components to remain consistent between wp-admin and the admin bar displayed on the front end.
- Update units used for font-sizing to use
pxunits instead ofrem - Adjust values if needed for consistency between wp-admin and front end rendering
Changelog entry
- Ensure Site Kit admin bar content is styled independently from the current theme.
Noticed this just earlier as well too. Let's fix it for next release.
IB ✅
@felixarntz after digging into this a bit, I'm realizing that using em as mentioned in the IB is going to work as well as I thought. Apparently em units are only relative to the parent element's font-size, it isn't inherited from ancestors like other rules (source).
After reaching out to a few of my colleagues, it seems that it's best to use absolute units instead, such as px. There are a few cases it seems where this should have been used anyways, such as other elements in the component (such as an arrow) where the size is fixed using px dimensions as well. For other cases where a component's style is shared with other areas and should remain more responsive (such as a datapoint), these can use fixed overrides for the admin bar specifically (assets/sass/components/adminbar/_googlesitekit-adminbar-overrides.scss).
Let me know if this is okay and I'll update the IB before continuing. Moving to blocked for now.
@aaemnnosttv Using px sounds reasonable here. 👍
Tested
Checked Swedish Museum:

Twenty Seventeen:

Twenty Nineteen

Twenty Sixteen

Astra:

Hello:

OceanWP:

Looks good!
Passed QA ✅
👁👍
