Sponsored Content
The Wayback Machine - https://web.archive.org/web/20210817024836/https://github.com/google/site-kit-wp/issues/888
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent Admin Bar module styling between themes #888

Closed
aaemnnosttv opened this issue Nov 21, 2019 · 6 comments
Closed

Inconsistent Admin Bar module styling between themes #888

aaemnnosttv opened this issue Nov 21, 2019 · 6 comments

Comments

@aaemnnosttv
Copy link
Collaborator

@aaemnnosttv aaemnnosttv commented Nov 21, 2019 •

Bug Description

The content displayed in Site Kit's admin bar varies in appearance when different themes are activated:

Twenty Nineteen

image

Twenty Twenty

image

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.

image

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 px units instead of rem
  • 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.
@felixarntz felixarntz added the P0 label Nov 21, 2019
@felixarntz felixarntz self-assigned this Nov 21, 2019
@felixarntz
Copy link
Member

@felixarntz felixarntz commented Nov 21, 2019

Noticed this just earlier as well too. Let's fix it for next release.

@felixarntz felixarntz removed their assignment Nov 21, 2019
@aaemnnosttv aaemnnosttv self-assigned this Nov 22, 2019
@felixarntz
Copy link
Member

@felixarntz felixarntz commented Nov 26, 2019

IB ✅

@felixarntz felixarntz removed their assignment Nov 26, 2019
@aaemnnosttv aaemnnosttv self-assigned this Dec 3, 2019
@aaemnnosttv aaemnnosttv added this to the 1.1.3 milestone Dec 3, 2019
@aaemnnosttv
Copy link
Collaborator Author

@aaemnnosttv aaemnnosttv commented Dec 4, 2019

@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.

@felixarntz
Copy link
Member

@felixarntz felixarntz commented Dec 5, 2019

@aaemnnosttv Using px sounds reasonable here. 👍

@felixarntz felixarntz removed their assignment Dec 10, 2019
@cole10up cole10up self-assigned this Dec 12, 2019
@cole10up
Copy link
Collaborator

@cole10up cole10up commented Dec 17, 2019

Tested

Checked Swedish Museum:
image

Twenty Seventeen:
image

Twenty Nineteen
image

Twenty Sixteen
image

Astra:
image

Hello:
image

OceanWP:
image

Looks good!

Passed QA ✅

@cole10up cole10up removed their assignment Dec 17, 2019
@marrrmarrr
Copy link
Collaborator

@marrrmarrr marrrmarrr commented Dec 17, 2019

👁👍

@marrrmarrr marrrmarrr closed this Dec 17, 2019
@ThierryA ThierryA removed this from the 1.1.4 milestone Feb 3, 2020
@ThierryA ThierryA added this to the Sprint 13 milestone Feb 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
6 participants