Skip to content

Commit

Permalink
Fix inconsistent admin color scheme when previewing on Simple Default…
Browse files Browse the repository at this point in the history
… (#39048)

* Inconsistent Color Scheme when previewing on Simple Default

* changelog

* Unload WPCOM_ADMIN_BAR_UNIFICATION

* Update comments

Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/10521189828

Upstream-Ref: Automattic/jetpack@b92ba9d
  • Loading branch information
okmttdhr authored and matticbot committed Aug 23, 2024
1 parent f5470c8 commit bfc582d
Show file tree
Hide file tree
Showing 9 changed files with 99 additions and 95 deletions.
60 changes: 30 additions & 30 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions vendor/automattic/jetpack-masterbar/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ This is an alpha version! The changes listed here are not final.
- Remove locale sync
- Updated package dependencies.

### Fixed
- Inconsistent Color Scheme when previewing on Simple Default

## [0.7.0] - 2024-08-21
### Changed
- Site Level User Profile: expose all relevant fields on profile.php [#38949]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ public function __construct() {
add_action( 'rest_api_init', array( $this, 'register_admin_color_meta' ) );
}

if ( ( defined( 'WPCOM_ADMIN_BAR_UNIFICATION' ) && WPCOM_ADMIN_BAR_UNIFICATION ) || get_option( 'wpcom_admin_interface' ) === 'wp-admin' ) { // Classic sites.
if ( ( defined( 'WPCOM_ADMIN_BAR_UNIFICATION' ) && WPCOM_ADMIN_BAR_UNIFICATION ) || get_option( 'wpcom_admin_interface' ) === 'wp-admin' ) { // Simple and Atomic sites.
add_filter( 'css_do_concat', array( $this, 'disable_css_concat_for_color_schemes' ), 10, 2 );
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_color_scheme_for_sidebar_notice' ) );
} else { // Default and self-hosted sites.
} else { // self-hosted sites.
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_core_color_schemes_overrides' ) );
}
}
Expand Down
1 change: 1 addition & 0 deletions vendor/automattic/jetpack-mu-wpcom/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ This is an alpha version! The changes listed here are not final.
### Fixed
- Admin bar: fix icon colors on site frontend
- Ensure theme update icon is hidden correctly
- Inconsistent Color Scheme when previewing on Simple Default

## [5.57.1] - 2024-08-21
### Changed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

namespace Automattic\Jetpack;

define( 'WPCOM_ADMIN_BAR_UNIFICATION', true );

/**
* Jetpack_Mu_Wpcom main class.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
// @TODO Ideally we should remove this feature entirely and update Jetpack_Mu_Wpcom::load_features to initialize
// Masterbar for both WoA and Simple sites.
// This would require removing the relevant Masterbar code on WPCOM and rely on the package only.
if ( get_option( 'wpcom_admin_interface' ) === 'wp-admin' && ( new Host() )->is_wpcom_simple() ) {
if ( ( new Host() )->is_wpcom_simple() ) {
new Admin_Color_Schemes();
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
use Automattic\Jetpack\Connection\Manager as Connection_Manager;
use Automattic\Jetpack\Jetpack_Mu_Wpcom;

define( 'WPCOM_ADMIN_BAR_UNIFICATION', true );

// The $icon-color variable for admin color schemes.
// See: https://github.com/WordPress/wordpress-develop/blob/679cc0c4a261a77bd8fdb140cd9b0b2ff80ebf37/src/wp-admin/css/colors/_variables.scss#L9
// Only the ones different from the "fresh" scheme are listed.
Expand Down
Loading

0 comments on commit bfc582d

Please sign in to comment.