Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
fd08766
Admin UI: Update the Modern, Fresh, Midnight, and Ectoplasm scheme co…
ciampo Nov 30, 2026
80aee76
Docs: Link the changelog entries
ciampo Nov 30, 2026
255d1e9
Base Styles: Use the new Fresh primary in the default custom properties
ciampo Nov 30, 2026
8eb9960
Boot: Require no color warnings in the white label scheme test
ciampo Nov 30, 2026
1f4e6df
Admin UI: Correct the scheme seed comment and changelog category
ciampo Nov 30, 2026
63380ce
Theme: Keep the legacy admin accent visible on the provider surfaces
ciampo Nov 30, 2026
460bbb0
Admin UI: Match the Ectoplasm sidebar to #523f6d exactly
ciampo Nov 30, 2026
56a2441
Theme: Keep white text readable on the legacy admin accent
ciampo Nov 30, 2026
7f30c12
Base Styles: Note why the Ectoplasm admin accent is not its primary
ciampo Nov 30, 2026
84c182d
Revert "Base Styles: Note why the Ectoplasm admin accent is not its p…
ciampo Nov 30, 2026
0e29c06
Revert "Theme: Keep white text readable on the legacy admin accent"
ciampo Nov 30, 2026
3e5abf7
Revert "Theme: Keep the legacy admin accent visible on the provider s…
ciampo Nov 30, 2026
c289284
Admin UI: Use a lime dark enough for white text as the Ectoplasm primary
ciampo Nov 30, 2026
28ab7b0
Admin UI: Test Ectoplasm's lime fill and every scheme's legacy accent
ciampo Nov 30, 2026
07df14c
Admin UI: Keep the Ectoplasm primary at least as dark as before
ciampo Nov 30, 2026
90886ad
E2E Tests: Compare the drop indicator with the scheme's accent color
ciampo Nov 30, 2026
4e9fff8
Boot: Require the exact Core sidebar color for Ectoplasm
ciampo Nov 30, 2026
37fdc5a
Admin UI: Test every scheme's primary against its WordPress 7.1 value
ciampo Nov 30, 2026
9c3eb96
Admin UI: Fail the baseline test when a bundled scheme goes missing
ciampo Nov 30, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
121 changes: 70 additions & 51 deletions lib/experimental/wpds-admin/css/05-scheme-tokens.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,45 +23,44 @@
@layer wpds-overrides, wp-legacy, wpds;

@layer wpds {
body.admin-color-fresh,
body.admin-color-light {
--wpds-color-background-indicator-brand: #0071ae;
--wpds-color-background-interactive-brand-strong: #007cba;
--wpds-color-background-interactive-brand-strong-active: #006ca9;
--wpds-color-background-interactive-brand-weak-active: #d9ecfa;
--wpds-color-background-surface-brand: #e3f2fd;
--wpds-color-background-thumb-brand: #0071ae;
--wpds-color-background-thumb-brand-active: #0071ae;
--wpds-color-background-thumb-brand-strong: #fff;
--wpds-color-foreground-interactive-brand: #0071ae;
--wpds-color-foreground-interactive-brand-active: #002041;
--wpds-color-foreground-interactive-brand-strong: #fff;
--wpds-color-foreground-interactive-brand-strong-active: #fff;
--wpds-color-stroke-focus: #0071ae;
--wpds-color-stroke-interactive-brand: #0071ae;
--wpds-color-stroke-interactive-brand-active: #00528b;
--wpds-color-stroke-surface-brand: #a5c7e1;
--wpds-color-stroke-surface-brand-strong: #0071ae;
body.admin-color-fresh {
--wpds-color-background-indicator-brand: #006daa;
--wpds-color-background-interactive-brand-strong: #006daa;
--wpds-color-background-interactive-brand-strong-active: #005e9a;
--wpds-color-background-interactive-brand-weak-active: #daebfa;
--wpds-color-background-surface-brand: #e4f1fd;
--wpds-color-background-thumb-brand: #006daa;
--wpds-color-background-thumb-brand-active: #006daa;
--wpds-color-background-thumb-brand-strong: #eef0f2;
--wpds-color-foreground-interactive-brand: #006daa;
--wpds-color-foreground-interactive-brand-active: #001f44;
--wpds-color-foreground-interactive-brand-strong: #eef0f2;
--wpds-color-foreground-interactive-brand-strong-active: #eef0f2;
--wpds-color-stroke-focus: #006daa;
--wpds-color-stroke-interactive-brand: #006daa;
--wpds-color-stroke-interactive-brand-active: #004e89;
--wpds-color-stroke-surface-brand: #a0c1dd;
--wpds-color-stroke-surface-brand-strong: #006daa;
}

body.admin-color-midnight {
--wpds-color-background-indicator-brand: #c43830;
--wpds-color-background-interactive-brand-strong: #cf4339;
--wpds-color-background-interactive-brand-strong-active: #be322a;
--wpds-color-background-indicator-brand: #bf332b;
--wpds-color-background-interactive-brand-strong: #bf332b;
--wpds-color-background-interactive-brand-strong-active: #ae201c;
--wpds-color-background-interactive-brand-weak-active: #f8e4e1;
--wpds-color-background-surface-brand: #faece9;
--wpds-color-background-thumb-brand: #c43830;
--wpds-color-background-thumb-brand-active: #c43830;
--wpds-color-background-thumb-brand-strong: #fffefe;
--wpds-color-foreground-interactive-brand: #c43830;
--wpds-color-background-surface-brand: #fbebe9;
--wpds-color-background-thumb-brand: #bf332b;
--wpds-color-background-thumb-brand-active: #bf332b;
--wpds-color-background-thumb-brand-strong: #f2efef;
--wpds-color-foreground-interactive-brand: #bf332b;
--wpds-color-foreground-interactive-brand-active: #470000;
--wpds-color-foreground-interactive-brand-strong: #fffefe;
--wpds-color-foreground-interactive-brand-strong-active: #fffefe;
--wpds-color-stroke-focus: #c43830;
--wpds-color-stroke-interactive-brand: #c43830;
--wpds-color-stroke-interactive-brand-active: #a10b0e;
--wpds-color-stroke-surface-brand: #e0b9b3;
--wpds-color-stroke-surface-brand-strong: #c43830;
--wpds-color-foreground-interactive-brand-strong: #f2efef;
--wpds-color-foreground-interactive-brand-strong-active: #f2efef;
--wpds-color-stroke-focus: #bf332b;
--wpds-color-stroke-interactive-brand: #bf332b;
--wpds-color-stroke-interactive-brand-active: #9c0007;
--wpds-color-stroke-surface-brand: #deb2ab;
--wpds-color-stroke-surface-brand-strong: #bf332b;
}

body.admin-color-coffee {
Expand Down Expand Up @@ -125,23 +124,23 @@
}

body.admin-color-ectoplasm {
--wpds-color-background-indicator-brand: #646c3e;
--wpds-color-background-interactive-brand-strong: #646c3e;
--wpds-color-background-interactive-brand-strong-active: #575e31;
--wpds-color-background-interactive-brand-weak-active: #e3f2a1;
--wpds-color-background-surface-brand: #e9f8a6;
--wpds-color-background-thumb-brand: #646c3e;
--wpds-color-background-thumb-brand-active: #646c3e;
--wpds-color-background-thumb-brand-strong: #eff2e3;
--wpds-color-foreground-interactive-brand: #646c3e;
--wpds-color-foreground-interactive-brand-active: #1c2100;
--wpds-color-foreground-interactive-brand-strong: #eff2e3;
--wpds-color-foreground-interactive-brand-strong-active: #eff2e3;
--wpds-color-stroke-focus: #646c3e;
--wpds-color-stroke-interactive-brand: #646c3e;
--wpds-color-stroke-interactive-brand-active: #495022;
--wpds-color-stroke-surface-brand: #b8c291;
--wpds-color-stroke-surface-brand-strong: #646c3e;
--wpds-color-background-indicator-brand: #606e00;
--wpds-color-background-interactive-brand-strong: #606e00;
--wpds-color-background-interactive-brand-strong-active: #536000;
--wpds-color-background-interactive-brand-weak-active: #def385;
--wpds-color-background-surface-brand: #e4f989;
--wpds-color-background-thumb-brand: #606e00;
--wpds-color-background-thumb-brand-active: #606e00;
--wpds-color-background-thumb-brand-strong: #eef3df;
--wpds-color-foreground-interactive-brand: #606e00;
--wpds-color-foreground-interactive-brand-active: #1b2200;
--wpds-color-foreground-interactive-brand-strong: #eef3df;
--wpds-color-foreground-interactive-brand-strong-active: #eef3df;
--wpds-color-stroke-focus: #606e00;
--wpds-color-stroke-interactive-brand: #606e00;
--wpds-color-stroke-interactive-brand-active: #455100;
--wpds-color-stroke-surface-brand: #b5c381;
--wpds-color-stroke-surface-brand-strong: #606e00;
}

body.admin-color-sunrise {
Expand All @@ -163,4 +162,24 @@
--wpds-color-stroke-surface-brand: #e2b99b;
--wpds-color-stroke-surface-brand-strong: #a1580c;
}

body.admin-color-light {
--wpds-color-background-indicator-brand: #0071ae;
--wpds-color-background-interactive-brand-strong: #007cba;
--wpds-color-background-interactive-brand-strong-active: #006ca9;
--wpds-color-background-interactive-brand-weak-active: #d9ecfa;
--wpds-color-background-surface-brand: #e3f2fd;
--wpds-color-background-thumb-brand: #0071ae;
--wpds-color-background-thumb-brand-active: #0071ae;
--wpds-color-background-thumb-brand-strong: #fff;
--wpds-color-foreground-interactive-brand: #0071ae;
--wpds-color-foreground-interactive-brand-active: #002041;
--wpds-color-foreground-interactive-brand-strong: #fff;
--wpds-color-foreground-interactive-brand-strong-active: #fff;
--wpds-color-stroke-focus: #0071ae;
--wpds-color-stroke-interactive-brand: #0071ae;
--wpds-color-stroke-interactive-brand-active: #00528b;
--wpds-color-stroke-surface-brand: #a5c7e1;
--wpds-color-stroke-surface-brand-strong: #0071ae;
}
}
1 change: 1 addition & 0 deletions packages/admin-ui/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

### Bug Fixes

- `getAdminThemeColors`: Darken the Modern, Fresh, and Midnight backgrounds, and the Fresh and Midnight primary colors, so the brand fill keeps a white label in the sidebar. Ectoplasm returns to Core's original purple sidebar, with a lime primary dark enough for white text ([#87673](https://github.com/WordPress/gutenberg/pull/87673)).
- `getAdminThemeColors`: Adjust the Blue and Sunrise background colors so the admin sidebar matches the WordPress 7.1 Core color schemes again ([#87420](https://github.com/WordPress/gutenberg/pull/87420)).

### Internal
Expand Down
19 changes: 14 additions & 5 deletions packages/admin-ui/src/admin-theme-colors/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ type AdminThemeColors = {

const DEFAULT_THEME_COLORS: AdminThemeColors = {
primary: '#3858e9',
background: '#222524',
background: '#121514',
};

/*
Expand All @@ -14,16 +14,25 @@ const DEFAULT_THEME_COLORS: AdminThemeColors = {
*
* The Blue and Sunrise background seeds are tuned so that the sidebar color
* they derive (`--wpds-color-background-surface-neutral-weak`) stays close to
* Core's `$base-color` for those schemes.
* Core's `$base-color` for those schemes. Ectoplasm's background is tuned the
* same way to Core's original `#523f6d`. Its primary keeps the hue of Core's
* original `#a3b745` lime, but is at least as dark as the previous `#646c3e`:
* legacy consumers draw `--wp-admin-theme-color`, which takes the primary
* unchanged, under white text and as text on light surfaces. The brand fill on
* the sidebar still comes out close to the original lime.
*
* The Modern, Fresh and Midnight backgrounds are dark enough for the brand
* fill to keep a white label at the required contrast, on the fill and on its
* active state. Fresh and Midnight also need a slightly darker primary.
*/
export const ADMIN_THEME_COLORS = new Map< string, AdminThemeColors >( [
[ 'modern', DEFAULT_THEME_COLORS ],
[ 'fresh', { primary: '#007cba', background: '#25292b' } ],
[ 'midnight', { primary: '#cf4339', background: '#3d4042' } ],
[ 'fresh', { primary: '#006daa', background: '#121618' } ],
[ 'midnight', { primary: '#bf332b', background: '#111416' } ],
[ 'coffee', { primary: '#916745', background: '#5b534d' } ],
[ 'ocean', { primary: '#567958', background: '#5f787f' } ],
[ 'blue', { primary: '#437aa8', background: '#24567e' } ],
[ 'ectoplasm', { primary: '#646c3e', background: '#4f386e' } ],
[ 'ectoplasm', { primary: '#606e00', background: '#544769' } ],
[ 'sunrise', { primary: '#ad631e', background: '#933330' } ],
[ 'light', { primary: '#007cba', background: '#eaeeed' } ],
] );
Expand Down
58 changes: 55 additions & 3 deletions packages/admin-ui/src/admin-theme-colors/test/index.jsdom.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,57 @@
import { describe, expect, it } from 'vitest';
import { getAdminThemeColors } from '../index';
import { ADMIN_THEME_COLORS, getAdminThemeColors } from '../index';

// WCAG contrast between two `#rrggbb` colors.
function getContrast( a: string, b: string ) {
const [ la, lb ] = [ a, b ].map( ( hex ) => {
const [ r, g, c ] = [ 1, 3, 5 ].map( ( i ) => {
const v = parseInt( hex.slice( i, i + 2 ), 16 ) / 255;
return v <= 0.04045 ? v / 12.92 : ( ( v + 0.055 ) / 1.055 ) ** 2.4;
} );
return 0.2126 * r + 0.7152 * g + 0.0722 * c;
} );
return ( Math.max( la, lb ) + 0.05 ) / ( Math.min( la, lb ) + 0.05 );
}

// Legacy consumers put white text on `--wp-admin-theme-color`, which
// `ThemeProvider` sets to the scheme's primary color unchanged.
describe( 'ADMIN_THEME_COLORS', () => {
it.each( [ ...ADMIN_THEME_COLORS ] )(
'keeps white text readable on the %s primary color',
( _scheme, { primary } ) => {
expect( getContrast( primary, '#ffffff' ) ).toBeGreaterThanOrEqual(
4.5
);
}
);

// Legacy consumers also draw it as text on light surfaces, such as the
// Global Styles shadow controls on `#f0f0f0`. No primary should read worse
// there than its WordPress 7.1 value.
const WORDPRESS_7_1_PRIMARIES: Record< string, string > = {
modern: '#3858e9',
fresh: '#007cba',
midnight: '#cf4339',
coffee: '#916745',
ocean: '#567958',
blue: '#437aa8',
ectoplasm: '#646c3e',
sunrise: '#ad631e',
light: '#007cba',
};

it.each( Object.entries( WORDPRESS_7_1_PRIMARIES ) )(
'keeps the %s primary color readable as text on light surfaces',
( scheme, former ) => {
const primary = ADMIN_THEME_COLORS.get( scheme )?.primary;

expect( primary ).toBeDefined();
expect( getContrast( primary!, '#f0f0f0' ) ).toBeGreaterThanOrEqual(
getContrast( former, '#f0f0f0' )
);
}
);
} );

describe( 'getAdminThemeColors', () => {
it( 'should return the colors for the admin theme from the body class', () => {
Expand All @@ -16,7 +68,7 @@ describe( 'getAdminThemeColors', () => {

expect( getAdminThemeColors() ).toEqual( {
primary: '#3858e9',
background: '#222524',
background: '#121514',
} );
} );

Expand All @@ -25,7 +77,7 @@ describe( 'getAdminThemeColors', () => {

expect( getAdminThemeColors() ).toEqual( {
primary: '#3858e9',
background: '#222524',
background: '#121514',
} );
} );
} );
1 change: 1 addition & 0 deletions packages/base-styles/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

### Enhancements

- The `wordpress-admin-schemes` mixin and the default custom properties now use `#006daa` for Fresh, and the mixin uses `#bf332b` for Midnight and `#606e00` for Ectoplasm, the primary colors of those schemes in `@wordpress/admin-ui` ([#87673](https://github.com/WordPress/gutenberg/pull/87673)).
- The `input-control` and `editor-input-reset` mixins now use the `--wpds-typography-font-size-md` design token for their font size ([#86961](https://github.com/WordPress/gutenberg/pull/86961)).

## 15.1.0 (2026-11-18)
Expand Down
2 changes: 1 addition & 1 deletion packages/base-styles/_default-custom-properties.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@

// Fresh has no rule in the admin-schemes.css shipped by older WordPress versions, so it would inherit the :root default above. Plugins bundle these defaults while WordPress supplies the scheme stylesheet, so the rule must travel with them.
body.admin-color-fresh {
@include mixins.admin-scheme(#007cba);
@include mixins.admin-scheme(#006daa);
}
6 changes: 3 additions & 3 deletions packages/base-styles/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@

@mixin wordpress-admin-schemes() {
body.admin-color-fresh {
@include admin-scheme(#007cba);
@include admin-scheme(#006daa);
}

body.admin-color-light {
Expand All @@ -448,11 +448,11 @@
}

body.admin-color-ectoplasm {
@include admin-scheme(#646c3e);
@include admin-scheme(#606e00);
}

body.admin-color-midnight {
@include admin-scheme(#cf4339);
@include admin-scheme(#bf332b);
}

body.admin-color-ocean {
Expand Down
Loading
Loading