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

Admin Color Schemes: Update color schemes to match Calypso #40908

Open
wants to merge 3 commits into
base: trunk
Choose a base branch
from

Conversation

ryelle
Copy link
Member

@ryelle ryelle commented Jan 8, 2025

See Automattic/wp-calypso#94471 — Many of the custom admin color schemes are slightly off in wp-admin, compared to the Calypso versions. This seems to be the case when a color scheme has a different color admin bar and admin menu (sidebar) - the core schemes are set up to use the same backgrounds and submenu colors. There are also some other minor issues with highlight colors.

Proposed changes:

  • Introduces $masterbar-submenu-background and $masterbar-submenu-background-alt for the admin bar submenu colors, so that the admin menu can use different colors.
  • Specific overrides for Bright and Powder Snow to ensure contrast when admin menu submenu text is dark, but admin bar text needs to be light. This CSS is pretty ridiculous, but it's all copied from the core _admin.scss for all assorted menu cases.
  • Additional cleanup of colors and overrides to make sure the icons and text match when focused/hovered/etc.

Screenshots

The first two in each row are the current behavior, so you can see how the proposed change will apply the Calypso versions. The proposed change column also shows the admin bar and admin menu submenus.

Calypso wp-admin Proposed change
aquatic-calypso aquatic-wp-admin wp-admin-aquatic
classic-blue-calypso classic-blue-wp-admin wp-admin-classic-blue
classic-bright-calypso classic-bright-wp-admin wp-admin-classic-bright
classic-dark-calypso classic-dark-wp-admin wp-admin-classic-dark
contrast-calypso contrast-wp-admin wp-admin-contrast
nightfall-calypso nightfall-wp-admin wp-admin-nightfall
powder-snow-calypso powder-snow-wp-admin wp-admin-snow
sakura-calypso sakura-wp-admin wp-admin-sakura
sunset-calypso sunset-wp-admin wp-admin-sunset

Other information:

  • Have you written new tests for your changes, if applicable?
  • Have you checked the E2E test CI results, and verified that your changes do not break them?
  • Have you tested your changes on WordPress.com, if applicable (if so, you'll see a generated comment below with a script to run)?

Does this pull request change what data or activity we track or use?

No

Testing instructions:

  1. Go to your user profile and select one of the custom color schemes
  2. View a calypso page and a wp-admin bar (e.g., https://yoursite.wordpress.com/wp-admin/edit.php and https://wordpress.com/posts/yoursite)
  3. The admin menu colors should match
  4. Icons should match the menu text, and generally not look "broken"

Note: I haven't been able to get the jetpack env set up locally, so I couldn't run any of the precommit checks — let me know if there's anything I'm missing here :) magically it worked today 🎉

@ryelle ryelle added [Feature] Masterbar WordPress.com Toolbar and Dashboard customizations [Package] Masterbar labels Jan 8, 2025
@ryelle ryelle requested a review from fushar January 8, 2025 23:07
@ryelle ryelle self-assigned this Jan 8, 2025
Copy link
Contributor

github-actions bot commented Jan 8, 2025

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • 🔴 Add a "[Status]" label (In Progress, Needs Team Review, ...).
  • ✅ Add a "[Type]" label (Bug, Enhancement, Janitorial, Task).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖


The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available.


Follow this PR Review Process:

  1. Ensure all required checks appearing at the bottom of this PR are passing.
  2. Choose a review path based on your changes:
    • A. Team Review: add the "[Status] Needs Team Review" label
      • For most changes, including minor cross-team impacts.
      • Example: Updating a team-specific component or a small change to a shared library.
    • B. Crew Review: add the "[Status] Needs Review" label
      • For significant changes to core functionality.
      • Example: Major updates to a shared library or complex features.
    • C. Both: Start with Team, then request Crew
      • For complex changes or when you need extra confidence.
      • Example: Refactor affecting multiple systems.
  3. Get at least one approval before merging.

Still unsure? Reach out in #jetpack-developers for guidance!


Mu Wpcom plugin:

  • Next scheduled release: WordPress.com Simple releases happen semi-continuously (PCYsg-Jjm-p2).

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Wpcomsh plugin:

  • Next scheduled release: Atomic deploys happen twice daily on weekdays (p9o2xV-2EN-p2).

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.

@github-actions github-actions bot added the [Status] Needs Author Reply We would need you to make some changes or provide some more details about your PR. Thank you! label Jan 8, 2025
Copy link
Contributor

github-actions bot commented Jan 8, 2025

Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.

  • To test on WoA, go to the Plugins menu on a WordPress.com Simple site. Click on the "Upload" button and follow the upgrade flow to be able to upload, install, and activate the Jetpack Beta plugin. Once the plugin is active, go to Jetpack > Jetpack Beta, select your plugin, and enable the try/sync-color-schemes branch.

    • For jetpack-mu-wpcom changes, also add define( 'JETPACK_MU_WPCOM_LOAD_VIA_BETA_PLUGIN', true ); to your wp-config.php file.
  • To test on Simple, run the following command on your sandbox:

    bin/jetpack-downloader test jetpack try/sync-color-schemes
    
    bin/jetpack-downloader test jetpack-mu-wpcom-plugin try/sync-color-schemes
    

Interested in more tips and information?

  • In your local development environment, use the jetpack rsync command to sync your changes to a WoA dev blog.
  • Read more about our development workflow here: PCYsg-eg0-p2
  • Figure out when your changes will be shipped to customers here: PCYsg-eg5-p2

@ryelle ryelle added [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. labels Jan 8, 2025
@github-actions github-actions bot removed the [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. label Jan 8, 2025
@github-actions github-actions bot added [Plugin] mu wpcom jetpack-mu-wpcom plugin [Plugin] Wpcomsh labels Jan 8, 2025
@ryelle ryelle added [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. and removed [Status] Needs Author Reply We would need you to make some changes or provide some more details about your PR. Thank you! [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. labels Jan 8, 2025
@github-actions github-actions bot added the [Status] Needs Author Reply We would need you to make some changes or provide some more details about your PR. Thank you! label Jan 8, 2025
@richtabor
Copy link

Any reason not to use core as the standard?

@ryelle
Copy link
Member Author

ryelle commented Jan 13, 2025

The core themes still exist, these are extras.

Though I have learned since making this PR that there's a separate wpcom wp-admin view for when you've selected the "Classic" view, so I'll revise my screenshots for this view:

Before After
aquatic-before aquatic-after
classic-blue-before classic-blue-after
classic-bright-before classic-bright-after
classic-dark-before classic-dark-after
contrast-before contrast-after
nightfall-before nightfall-after
sakura-before sakura-after
snow-before snow-after
sunset-before sunset-after

@@ -1,3 +1,52 @@
@import "variables";
@import "../admin";
@import "sidebar-notice";

// Specific overrides for this color scheme.
.admin-color-classic-bright {
Copy link
Contributor

Choose a reason for hiding this comment

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

We're going to remove Calypso version of the single-site view (nav unification) as part of the Untangling Calypso project in the future. Given that, is it that worth it to maintain this kind of override (for Classic Bright and Powder Snow)?

I'd imagine this could cause some confusion for future devs 🤔

For the record, I'm not sure for this set of colors, which comes first, Calypso's or wp-admin's. 😅

Copy link
Member Author

Choose a reason for hiding this comment

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

IIRC these were designed for Calypso and ported back to wp-admin, which is probably why they don't slot in nicely with the color theming system. But I don't think that's a reason get rid of them - I'm always a fan of color schemes (I should update that plugin 😅).

The generated CSS assumes the admin bar and admin menu use the same background & text colors, and _overrides.scss handles setting the background color for the top bar ($masterbar-background), but does not change the text. So in Classic Bright & Powder Snow, when the admin menu dropdowns are updated to dark text on light background, this causes the admin bar dropdowns to be dark text on a (overridden) dark background.

So this override is necessary, somehow. It could be moved to _overrides.scss, but with only two affected I opted to not add even more variables + redundant CSS to all schemes.

Another option could be to update the style of the color schemes, so that the admin bar and admin menu dropdowns both use the same background & dropdown colors, then the colors should inherit correctly from the Sass variables. But that seemed like a design decision, and I was just aiming to replicate the calypso look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Masterbar WordPress.com Toolbar and Dashboard customizations [Package] Masterbar [Plugin] mu wpcom jetpack-mu-wpcom plugin [Plugin] Wpcomsh [Status] Needs Author Reply We would need you to make some changes or provide some more details about your PR. Thank you! [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.

3 participants