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

Masterbar: Update colors so they match Modern (default) color scheme. #98542

Merged
merged 1 commit into from
Jan 23, 2025

Conversation

jasmussen
Copy link
Member

@jasmussen jasmussen commented Jan 17, 2025

Related to https://github.com/Automattic/dotcom-forge/issues/8519

Proposed Changes

Updates masterbar colors to match the Modern color scheme, which is the default admin color scheme.

Before

Screenshot 2025-01-17 at 14 29 57

Screenshot 2025-01-17 at 14 30 04

Screenshot 2025-01-17 at 14 30 36

After

Screenshot 2025-01-17 at 14 25 21

Screenshot 2025-01-17 at 14 25 31

Screenshot 2025-01-17 at 14 25 59

Why are these changes being made?

There are color scheme colors from individual site installs, and then global Calypso styles. Over time, colors have drifted out of sync, likely as default admin color schemes have been updated, and changed.

This PR fixes issues with the Modern color scheme (there was a contrast issue with the unread bell), and syncs up the color schemes applied to Calypso (Reader, Me, Sites) so they match the default Modern color scheme.

That specifically includes updating the grays. The default shades of gray in the WordPress design system (as defined here) are not yet in Color Studio, and must therefore be defined inline. CC: @Automattic/dotcom-design

Testing Instructions

Apply the PR, then test the wp-admin sections, such as Users > Profile, as well as Reader, Me, and Sites, to see if the colors of the adminbar/masterbar match.

Pre-merge Checklist

  • Has the general commit checklist been followed? (PCYsg-hS-p2)
  • Have you written new tests for your changes?
  • Have you tested the feature in Simple (P9HQHe-k8-p2), Atomic (P9HQHe-jW-p2), and self-hosted Jetpack sites (PCYsg-g6b-p2)?
  • Have you checked for TypeScript, React or other console errors?
  • Have you used memoizing on expensive computations? More info in Memoizing with create-selector and Using memoizing selectors and Our Approach to Data
  • Have we added the "[Status] String Freeze" label as soon as any new strings were ready for translation (p4TIVU-5Jq-p2)?
    • For UI changes, have we tested the change in various languages (for example, ES, PT, FR, or DE)? The length of text and words vary significantly between languages.
  • For changes affecting Jetpack: Have we added the "[Status] Needs Privacy Updates" label if this pull request changes what data or activity we track or use (p4TIVU-aUh-p2)?

@jasmussen jasmussen self-assigned this Jan 17, 2025
@jasmussen jasmussen added the [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it label Jan 17, 2025
@matticbot
Copy link
Contributor

This PR does not affect the size of JS and CSS bundles shipped to the user's browser.

Generated by performance advisor bot at iscalypsofastyet.com.

@jasmussen jasmussen requested a review from adamwoodnz January 20, 2025 10:54
@matticbot matticbot added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Jan 20, 2025
Comment on lines +64 to +65
--color-masterbar-text: #fff; // From "Modern" color scheme.
--color-masterbar-icon: #fff; // From "Modern" color scheme.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason not to use var(--studio-white) for these? It maps to this value.

Copy link
Member Author

@jasmussen jasmussen Jan 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent question. I thought about this, but had the feeling that this is the Modern color scheme, it's not any colo scheme from the Studio colors. I'd appreciate input from @Automattic/dotcom-design, as it's trivial for me to update.

Thank you for the review!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. @jasmussen do you know where the color schemes are stored? That could help us understand if the values are always hard-coded or not.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, they are stored here: https://github.com/Automattic/wp-calypso/tree/trunk/packages/calypso-color-schemes/src/shared/color-schemes

But it's a bit of a mess, with what at a quick glance looks like a ton of circular variables, an almost literal rabbit hole. Perhaps it's because I'm fresh to the latest iteration of the codebase, but --color-sidebar-submenu-selected-text: var(--color-text-inverted); is a mystery to me. There are also situational overrides and separate concessions per section. For example for this PR I had to also edit this file: https://github.com/Automattic/wp-calypso/blob/trunk/client/my-sites/sidebar/style.scss

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if it's possible to import color values from Gutenberg, and use those instead of these custom vars?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coming back to this, Calypso imports the core base-styles, so I can import base-styles/color giving me access to the range of $white, $black, and $gray-100 to $gray-900. But it's not clear that's worth it.

You're probably referring to these colors:
Screenshot 2025-01-22 at 14 20 30

Those are present in the admin contexts, but it's not clear to me those are available in the expanded contexts (/me, /sites, /read, etc.) I think it's for that reason that some place in the codebase, we have this remapping:

--wp-admin-theme-color: var(--color-accent);

I'm genuinely unsure what the best path forward is, but I'm increasingly tempted to merge this as is and follow up. What do you think?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wouldn't go that way without a general plan forward for color schemes.

Right now things can get really thorny with the existing Calypso color schemes in place. Especially when we aim for consistency in wp-admin too.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for looking. I hear this as an argument to not use Studio colors, yes? If yes, I'll hardcode the blueberry again!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was talking about core colors and not studio colors. Studio colors make sense to be used instead of hardcoded colors, they're used broadly across Calypso already.

I was mostly saying that if we want to use core colors, we might want to do it more broadly, and it will be a gigantic effort across the app.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just in case we wanted to do so, we could look at importing @wordpress/base-styles/variables and @wordpress/base-styles/mixins and use the admin-scheme mixin

Copy link

@adamwoodnz adamwoodnz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, works for me 👍

Left one question inline.

@fcoveram
Copy link

The new version looks great 👌

@jasmussen
Copy link
Member Author

CC: @Automattic/team-calypso in case you have thoughts, specifically on this question.

@crisbusquets
Copy link
Contributor

It works for me, @jasmussen ! Thanks for working on this 🚀

Copy link
Member

@tyxla tyxla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is "Modern" really the default color scheme?

"Default" and "Modern" are two different ones from what I see:

Screenshot 2025-01-23 at 11 53 16

@jasmussen
Copy link
Member Author

Default is the WordPress core default. But Modern is the default that gets set for any new site created on WordPress.com. Default also uses the same Blueberry color that is the default WordPress.com brand color. Because of those two de-facto defaults, (despite the core term "default"), the default colors in the rest of the admin should match. What do you think?

@tyxla
Copy link
Member

tyxla commented Jan 23, 2025

Default is the WordPress core default. But Modern is the default that gets set for any new site created on WordPress.com. Default also uses the same Blueberry color that is the default WordPress.com brand color. Because of those two de-facto defaults, (despite the core term "default"), the default colors in the rest of the admin should match. What do you think?

Makes sense to me, and I've confirmed "Modern" gets assigned by default 👍

I guess we should rename "Default" to something else then. As a user, I'm confused I end up with another color scheme by default 😅

@jasmussen
Copy link
Member Author

I guess we should rename "Default" to something else then. As a user, I'm confused I end up with another color scheme by default 😅

"Classic". How does this fit with untangling work, though? And does it have to be part of this PR or can it be separate? The blueberry is already de-facto default, right now the adminbar is just a mix of colors.

Most importantly: I'm unsure about the answer to this question. Should I disconnect the blueberry for the modern color scheme, hard-code it again to #3858e9 instead of the studio reference? Or keep this as is and merge?

Copy link
Member

@tyxla tyxla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is good to go IMHO 👍 as long as we keep the comments, I'm fine with the hardcoded colors.

@tyxla
Copy link
Member

tyxla commented Jan 23, 2025

I guess we should rename "Default" to something else then. As a user, I'm confused I end up with another color scheme by default 😅

"Classic". How does this fit with untangling work, though? And does it have to be part of this PR or can it be separate? The blueberry is already de-facto default, right now the adminbar is just a mix of colors.

This isn't something for this PR obviously 😉 Let's discuss it separately.

Most importantly: I'm unsure about the answer to this question. Should I disconnect the blueberry for the modern color scheme, hard-code it again to #3858e9 instead of the studio reference? Or keep this as is and merge?

I'm fine to keep as-is, as long as we have the comment. Thanks!

@jasmussen jasmussen merged commit 537e80b into trunk Jan 23, 2025
17 of 22 checks passed
@jasmussen jasmussen deleted the try/update-masterbar-modern-colors branch January 23, 2025 12:48
@github-actions github-actions bot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Jan 23, 2025
@jasmussen
Copy link
Member Author

Appreciate all the gut checks. Now merged, and will go through the deploy process. I hope and expect future PRs to hopefully go through more smoothly!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants