Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
2c36431
Add an experiment that restyles wp-admin from design system tokens
jasmussen Aug 28, 2026
15d7d34
Grey the dropdown arrow on aria-disabled selects
jasmussen Aug 28, 2026
311e41b
Let form controls inherit their font size
jasmussen Aug 28, 2026
96e9e33
Load the restyle stylesheets in filename order
jasmussen Sep 3, 2026
e35fa8a
Leave the media handle undemoted
jasmussen Sep 4, 2026
40c56ef
Name the experiment for what it does
jasmussen Sep 4, 2026
81df8dd
Name the harness for what it shows
jasmussen Sep 4, 2026
6b1606b
Use the design system's field background and placeholder tokens
jasmussen Sep 16, 2026
ff4a281
Scope disabled field styles to text-like inputs
jasmussen Sep 16, 2026
a056b6f
Give invalid fields an error-coloured focus ring
jasmussen Sep 16, 2026
e1ce4e9
Keep grouped buttons joined
jasmussen Sep 16, 2026
6bcceca
Stop aria-disabled harness specimens from responding to input
jasmussen Sep 16, 2026
071f5ca
Update @since tags to 24.1.0
jasmussen Sep 16, 2026
3bfc605
Derive design tokens for each admin colour scheme
jasmussen Sep 16, 2026
c417b95
Pair button and checkbox colours as the design system does
jasmussen Sep 16, 2026
cd72bbf
Show a selected button in the harness's button groups
jasmussen Sep 16, 2026
057fcfb
Move the scheme token generator into the monorepo tools workspace
jasmussen Sep 17, 2026
fd36080
Describe the experiment without calling the admin classic or Core
jasmussen Sep 17, 2026
40349df
Read the admin colour schemes from admin-ui instead of a copied list
jasmussen Sep 17, 2026
d26d84e
Declare the scheme token generator's package dependencies
jasmussen Sep 17, 2026
02ae43a
Move the experiment's stylelint rules into the shared config
jasmussen Sep 17, 2026
31bbb3a
Add a changelog entry for the admin-ui scheme map export
jasmussen Sep 17, 2026
79dc2f8
Address feedback
jasmussen Sep 29, 2026
38f0bc7
Take tokens for the button metrics, and fix two control inconsistencies
jasmussen Sep 29, 2026
160d036
Say in the experiment description that it is not for live sites
jasmussen Sep 29, 2026
49cccdf
Fix the demoted URL escaping, the colour scheme preview and a harness…
jasmussen Oct 1, 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
5 changes: 5 additions & 0 deletions lib/experimental/experiments/load.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,11 @@ function gutenberg_initialize_experiments_settings() {
'label' => __( 'Guidelines', 'gutenberg' ),
'description' => __( 'Enables the Guidelines page under Settings and the experimental knowledge storage (wp_knowledge).', 'gutenberg' ),
),
array(
'id' => 'gutenberg-wpds-admin-restyle',
'label' => __( 'Admin design tokens', 'gutenberg' ),
'description' => __( 'Styles wp-admin from WordPress Design System tokens, so every admin screen reads as one product regardless of how it is rendered. No markup changes. (Warning: this can change how plugin styles apply to admin screens, and it loads admin stylesheets one by one instead of combined. Use it for testing, not on a live site.)', 'gutenberg' ),
),
array(
'id' => 'gutenberg-dashboard-widgets',
'label' => __( 'New Dashboard experience', 'gutenberg' ),
Expand Down
152 changes: 152 additions & 0 deletions lib/experimental/wpds-admin/css/05-scheme-tokens.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
/**
* Design tokens for each bundled admin colour scheme.
*
* GENERATED FILE. Do not edit. Regenerate with:
*
* npm run wpds:admin-scheme-tokens --workspace @wordpress/monorepo-tools
*
* React admin screens derive these values at runtime through ThemeProvider.
* PHP-rendered screens have no provider, so without this file every token
* would keep the default scheme's value, and scheme-coloured controls would
* pair the scheme's background with text chosen for the default blue. Only
* tokens that differ from the default scheme are listed.
*
* Setting `--wpds-*` properties is reserved for the theme package.
*
* DELETE WHEN: `@wordpress/theme` can generate these tokens outside React and
* wp-admin loads them for the active colour scheme, which will also need to
* cover custom colour seeds (Core-66026, Core-65776).
*/

/* stylelint-disable plugin-wpds/no-setting-wpds-custom-properties -- Generated equivalent of ThemeProvider's runtime output. */

@layer wpds-overrides, wp-legacy, wpds;

@layer wpds {
Comment on lines +23 to +25

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm not sure about the use of layering here. None of what we do today in design-tokens.css or ThemeProvider deals with layers. We've treated layers as a concern of @wordpress/ui, not @wordpress/theme.

I also don't think these layers are valid, unless I'm missing something. Particularly wpds-overrides, which I expect may be referring to the nested wpds.overrides.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good stuff, and you're right. The layer buys nothing, and it shouldn't imply that @wordpress/theme has a layering model.

On the names: wpds, wpds-overrides and wp-legacy are the experiment's own. That you read wpds-overrides as a nested overrides layer tells me the naming is misleading, so I'll rename them to something unmistakably local, such as admin-tokens, admin-legacy and admin-tokens-overrides. Open to suggestions.

Why the other stylesheets are layered at all: it isn't an extension of the design system's layering, it's how the experiment reaches wp-admin's stylesheets from a plugin. Unlayered CSS beats layered CSS, so wp-admin's own sheets are imported into a lower layer and ours sit above, which also keeps unlayered plugin CSS winning over both. It's scaffolding, and it goes away when these styles move into WordPress itself.

I'll make both changes after #83114 lands, since it touches the same file and the generator. OR, feel free to push and commit directly to this branch if you prefer.

I want to convey that I'm laissez faire about this branch and experiment: it exists to serve a purpose which is to validate and test tokens in the admin. But the actual PRs to bring tokens to the admin are not this PR, but separate individual PRs to wp-develop, where we can point to this branch or experiment as a first testbed to validate the safety and contrast benefits. Is that fair?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Depending on your own timelines, it might be better to keep #83114 separate from this one. Since that adds a new API, I think it'll need a thorough vetting before we choose to land it. It might also be something we end up adding as a private API so we can shake out any issues with the approach before it becomes available in a stable WordPress release (including this experiment itself as part of that validation work).

I still don't know that I'm entirely sold on the use of layers, or maybe I'm not fully following the approach. My hunch is that we could solve this without layering via either selector specificity or stylesheet load order.

body.admin-color-fresh,
body.admin-color-light {
--wpds-color-background-interactive-brand-strong: #007cba;
--wpds-color-background-interactive-brand-strong-active: #006daa;
--wpds-color-background-interactive-brand-weak-active: #daecfb;
--wpds-color-background-surface-brand: #e4f2fd;
--wpds-color-background-thumb-brand: #0073b0;
--wpds-color-background-thumb-brand-active: #0073b0;
--wpds-color-foreground-interactive-brand: #0073b0;
--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: #0073b0;
--wpds-color-stroke-interactive-brand: #0073b0;
--wpds-color-stroke-interactive-brand-active: #00558f;
--wpds-color-stroke-surface-brand: #a6c7e1;
--wpds-color-stroke-surface-brand-strong: #0073b0;
}

body.admin-color-midnight {
--wpds-color-background-interactive-brand-strong: #cf4339;
--wpds-color-background-interactive-brand-strong-active: #bf332b;
--wpds-color-background-interactive-brand-weak-active: #f8e5e2;
--wpds-color-background-surface-brand: #fbecea;
--wpds-color-background-thumb-brand: #c63a31;
--wpds-color-background-thumb-brand-active: #c63a31;
--wpds-color-foreground-interactive-brand: #c63a31;
--wpds-color-foreground-interactive-brand-active: #470000;
--wpds-color-foreground-interactive-brand-strong: #fefdfd;
--wpds-color-foreground-interactive-brand-strong-active: #fefdfd;
--wpds-color-stroke-focus: #c63a31;
--wpds-color-stroke-interactive-brand: #c63a31;
--wpds-color-stroke-interactive-brand-active: #a41111;
--wpds-color-stroke-surface-brand: #e0bab4;
--wpds-color-stroke-surface-brand-strong: #c63a31;
}

body.admin-color-coffee {
--wpds-color-background-interactive-brand-strong: #916745;
--wpds-color-background-interactive-brand-strong-active: #835a38;
--wpds-color-background-interactive-brand-weak-active: #f8e6d9;
--wpds-color-background-surface-brand: #fbede2;
--wpds-color-background-thumb-brand: #8e6442;
--wpds-color-background-thumb-brand-active: #8e6442;
--wpds-color-foreground-interactive-brand: #8e6442;
--wpds-color-foreground-interactive-brand-active: #361300;
--wpds-color-foreground-interactive-brand-strong: #f7f5f4;
--wpds-color-foreground-interactive-brand-strong-active: #f7f5f4;
--wpds-color-stroke-focus: #8e6442;
--wpds-color-stroke-interactive-brand: #8e6442;
--wpds-color-stroke-interactive-brand-active: #704827;
--wpds-color-stroke-surface-brand: #dcbda4;
--wpds-color-stroke-surface-brand-strong: #8e6442;
}

body.admin-color-ocean {
--wpds-color-background-interactive-brand-strong: #567958;
--wpds-color-background-interactive-brand-strong-active: #496b4b;
--wpds-color-background-interactive-brand-weak-active: #d0f4d2;
--wpds-color-background-surface-brand: #ddf7de;
--wpds-color-background-thumb-brand: #537655;
--wpds-color-background-thumb-brand-active: #537655;
--wpds-color-foreground-interactive-brand: #537655;
--wpds-color-foreground-interactive-brand-active: #042609;
--wpds-color-foreground-interactive-brand-strong: #f5f8f5;
--wpds-color-foreground-interactive-brand-strong-active: #f5f8f5;
--wpds-color-stroke-focus: #537655;
--wpds-color-stroke-interactive-brand: #537655;
--wpds-color-stroke-interactive-brand-active: #385a3b;
--wpds-color-stroke-surface-brand: #a2cfa4;
--wpds-color-stroke-surface-brand-strong: #537655;
}

body.admin-color-blue {
--wpds-color-background-interactive-brand-strong: #437aa8;
--wpds-color-background-interactive-brand-strong-active: #356c99;
--wpds-color-background-interactive-brand-weak-active: #dfebf7;
--wpds-color-background-surface-brand: #e8f1fa;
--wpds-color-background-thumb-brand: #3b729f;
--wpds-color-background-thumb-brand-active: #3b729f;
--wpds-color-foreground-interactive-brand: #3b729f;
--wpds-color-foreground-interactive-brand-active: #001f46;
--wpds-color-foreground-interactive-brand-strong: #fff;
--wpds-color-foreground-interactive-brand-strong-active: #fff;
--wpds-color-stroke-focus: #3b729f;
--wpds-color-stroke-interactive-brand: #3b729f;
--wpds-color-stroke-interactive-brand-active: #1d5581;
--wpds-color-stroke-surface-brand: #afc6db;
--wpds-color-stroke-surface-brand-strong: #3b729f;
}

body.admin-color-ectoplasm {
--wpds-color-background-interactive-brand-strong: #646c3e;
--wpds-color-background-interactive-brand-strong-active: #575f31;
--wpds-color-background-interactive-brand-weak-active: #e4f2a2;
--wpds-color-background-surface-brand: #e9f8a7;
--wpds-color-background-thumb-brand: #646c3e;
--wpds-color-background-thumb-brand-active: #646c3e;
--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: #495023;
--wpds-color-stroke-surface-brand: #b7c090;
--wpds-color-stroke-surface-brand-strong: #646c3e;
}

body.admin-color-sunrise {
--wpds-color-background-interactive-brand-strong: #ad631e;
--wpds-color-background-interactive-brand-strong-active: #9e5505;
--wpds-color-background-interactive-brand-weak-active: #fbe5d5;
--wpds-color-background-surface-brand: #feecdf;
--wpds-color-background-thumb-brand: #a35a10;
--wpds-color-background-thumb-brand-active: #a35a10;
--wpds-color-foreground-interactive-brand: #a35a10;
--wpds-color-foreground-interactive-brand-active: #371100;
--wpds-color-foreground-interactive-brand-strong: #fff;
--wpds-color-foreground-interactive-brand-strong-active: #fff;
--wpds-color-stroke-focus: #a35a10;
--wpds-color-stroke-interactive-brand: #a35a10;
--wpds-color-stroke-interactive-brand-active: #843d00;
--wpds-color-stroke-surface-brand: #e3ba9c;
--wpds-color-stroke-surface-brand-strong: #a35a10;
}
}
Loading
Loading