From dc5d5bfed88c882745aff0ac61b3e120492f257c Mon Sep 17 00:00:00 2001 From: Adam Wood <1017872+adamwoodnz@users.noreply.github.com> Date: Mon, 28 Sep 2026 15:51:52 +1300 Subject: [PATCH 1/5] Storybook: Default the admin theme color to blueberry The block-editor and block-library stylesheets load after @wordpress/components and set --wp-admin-theme-color to the legacy #007cba on :root, overriding the #3858e9 that components sets. Stories then render in a scheme few wp-admin users see. Charts are affected most: their first series color reads this variable, so every chart story showed the wrong palette. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01P6pdsb2opCsCz4AxKEoRfC --- projects/js-packages/storybook/storybook/style.scss | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/projects/js-packages/storybook/storybook/style.scss b/projects/js-packages/storybook/storybook/style.scss index 90e3457d1db8..9b8632df731d 100644 --- a/projects/js-packages/storybook/storybook/style.scss +++ b/projects/js-packages/storybook/storybook/style.scss @@ -1,5 +1,6 @@ // Root variables from js-packages base styles @use "../../base-styles/root-variables"; +@use "@wordpress/base-styles/mixins"; // @wordpress package styles @import "@wordpress/components/build-style/style.css"; @@ -7,3 +8,10 @@ @import "@wordpress/block-library/build-style/style.css"; @import "@wordpress/block-library/build-style/theme.css"; @import "@wordpress/block-library/build-style/editor.css"; + +// The block-editor and block-library styles reset the admin color to the +// legacy #007cba; use the modern scheme's blueberry instead. +:root { + + @include mixins.admin-scheme(#3858e9); +} From 5687e406ea3a8f6559ead4d1cc4e287f96a2e94d Mon Sep 17 00:00:00 2001 From: Adam Wood <1017872+adamwoodnz@users.noreply.github.com> Date: Mon, 28 Sep 2026 15:51:55 +1300 Subject: [PATCH 2/5] Storybook: Add changelog entry for the admin color fix Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01P6pdsb2opCsCz4AxKEoRfC --- ...5-charts-storybook-does-not-use-the-modern-wp-color-scheme | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 projects/js-packages/storybook/changelog/charts-285-charts-storybook-does-not-use-the-modern-wp-color-scheme diff --git a/projects/js-packages/storybook/changelog/charts-285-charts-storybook-does-not-use-the-modern-wp-color-scheme b/projects/js-packages/storybook/changelog/charts-285-charts-storybook-does-not-use-the-modern-wp-color-scheme new file mode 100644 index 000000000000..e27be0b381d8 --- /dev/null +++ b/projects/js-packages/storybook/changelog/charts-285-charts-storybook-does-not-use-the-modern-wp-color-scheme @@ -0,0 +1,4 @@ +Significance: patch +Type: fixed + +Use the modern WordPress admin color scheme (blueberry) as the default admin theme color in stories. From b2e5ab629892749ee47f331d24d3b5149717d85e Mon Sep 17 00:00:00 2001 From: Adam Wood <1017872+adamwoodnz@users.noreply.github.com> Date: Mon, 28 Sep 2026 16:09:32 +1300 Subject: [PATCH 3/5] Address review: Note that the admin color override must follow the imports The :root rule ties on specificity with the imported block styles, so moving it above them silently brings back #007cba. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01P6pdsb2opCsCz4AxKEoRfC --- projects/js-packages/storybook/storybook/style.scss | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/js-packages/storybook/storybook/style.scss b/projects/js-packages/storybook/storybook/style.scss index 9b8632df731d..f7af51b531f3 100644 --- a/projects/js-packages/storybook/storybook/style.scss +++ b/projects/js-packages/storybook/storybook/style.scss @@ -9,8 +9,8 @@ @import "@wordpress/block-library/build-style/theme.css"; @import "@wordpress/block-library/build-style/editor.css"; -// The block-editor and block-library styles reset the admin color to the -// legacy #007cba; use the modern scheme's blueberry instead. +// block-editor and block-library reset the admin color to the legacy #007cba. +// Keep this after the imports: equal specificity, so source order decides. :root { @include mixins.admin-scheme(#3858e9); From 6c6d70d789e46c2033a91fc517e1433ede03dc3e Mon Sep 17 00:00:00 2001 From: Adam Wood <1017872+adamwoodnz@users.noreply.github.com> Date: Mon, 28 Sep 2026 17:01:52 +1300 Subject: [PATCH 4/5] Charts: Correct Storybook comments about the default admin color The decorator comment said that, with no scheme set, the admin color is the ThemeProvider's accent. That held only for the custom theme. Every other story read Storybook's :root value, which is why they rendered in #007cba. The scheme list comment named a `default` scheme that WordPress 7.0 replaced with `modern`. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01P6pdsb2opCsCz4AxKEoRfC --- ...-charts-storybook-does-not-use-the-modern-wp-color-scheme | 5 +++++ projects/js-packages/charts/src/stories/chart-decorator.tsx | 5 ++--- projects/js-packages/charts/src/stories/theme-config.tsx | 4 ++-- 3 files changed, 9 insertions(+), 5 deletions(-) create mode 100644 projects/js-packages/charts/changelog/charts-285-charts-storybook-does-not-use-the-modern-wp-color-scheme diff --git a/projects/js-packages/charts/changelog/charts-285-charts-storybook-does-not-use-the-modern-wp-color-scheme b/projects/js-packages/charts/changelog/charts-285-charts-storybook-does-not-use-the-modern-wp-color-scheme new file mode 100644 index 000000000000..d6eb9cb527d2 --- /dev/null +++ b/projects/js-packages/charts/changelog/charts-285-charts-storybook-does-not-use-the-modern-wp-color-scheme @@ -0,0 +1,5 @@ +Significance: patch +Type: changed +Comment: Correct Storybook comments about the default admin color scheme. + + diff --git a/projects/js-packages/charts/src/stories/chart-decorator.tsx b/projects/js-packages/charts/src/stories/chart-decorator.tsx index e69f486a5010..d5732baf6a25 100644 --- a/projects/js-packages/charts/src/stories/chart-decorator.tsx +++ b/projects/js-packages/charts/src/stories/chart-decorator.tsx @@ -128,9 +128,8 @@ const isValidHexColor = ( color: string ): boolean => { * * One declaration, and it is the same one WordPress makes: `admin-schemes.css` sets * `--wp-admin-theme-color` on `body.admin-color-`. The palette's slot 1 names that - * variable first, so this is enough to exercise the whole path Storybook otherwise cannot — - * every story renders a `ThemeProvider`, and without a scheme set the admin color it publishes - * is whatever the provider's accent is. + * variable first, so this is enough to exercise the whole path. Without a scheme, the value is + * the custom theme's accent (which `ThemeProvider` publishes) or else Storybook's `:root` default. * * @param scheme - A key of `WP_ADMIN_COLOR_SCHEMES`, or `NO_ADMIN_COLOR_SCHEME`. * @return The wrapper's inline custom property, or undefined to leave the page as it is. diff --git a/projects/js-packages/charts/src/stories/theme-config.tsx b/projects/js-packages/charts/src/stories/theme-config.tsx index 75a97650363a..d2b98d3fcdb3 100644 --- a/projects/js-packages/charts/src/stories/theme-config.tsx +++ b/projects/js-packages/charts/src/stories/theme-config.tsx @@ -62,8 +62,8 @@ export const mixedColorFormatRoles: Record< string, string > = { * The `--wp-admin-theme-color` each WordPress admin color scheme publishes, copied from * `@wordpress/base-styles`' `admin-schemes.css`. * - * `fresh` and `default` have no `admin-color-*` block of their own and take the `:root` value, - * so they are absent here rather than duplicated. + * `fresh` has no `admin-color-*` block of its own and takes the host's `:root` value, so it is + * absent here. `modern` is the WordPress default since 7.0. */ export const WP_ADMIN_COLOR_SCHEMES: Record< string, string > = { light: '#007cba', From 476e991e861889d0277ad8c1bc6cfdb89066aadf Mon Sep 17 00:00:00 2001 From: Adam Wood <1017872+adamwoodnz@users.noreply.github.com> Date: Tue, 29 Sep 2026 14:46:32 +1300 Subject: [PATCH 5/5] Address review: Link the upstream fix for the admin color override The override only exists because @wordpress/base-styles still defaults to #007cba. Naming the Gutenberg PR tells a future reader when it is safe to delete. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01P6pdsb2opCsCz4AxKEoRfC --- projects/js-packages/storybook/storybook/style.scss | 2 ++ 1 file changed, 2 insertions(+) diff --git a/projects/js-packages/storybook/storybook/style.scss b/projects/js-packages/storybook/storybook/style.scss index f7af51b531f3..094ae7a31f2d 100644 --- a/projects/js-packages/storybook/storybook/style.scss +++ b/projects/js-packages/storybook/storybook/style.scss @@ -11,6 +11,8 @@ // block-editor and block-library reset the admin color to the legacy #007cba. // Keep this after the imports: equal specificity, so source order decides. +// Remove once @wordpress/base-styles ships the modern default: +// https://github.com/WordPress/gutenberg/pull/83749 :root { @include mixins.admin-scheme(#3858e9);