Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
a71c91a
add built base admin color schemes built file that can be consumed by…
fabiankaegy Feb 10, 2025
83ea0b4
register new wp-admin-schemes handle in 6.8 compat folder
fabiankaegy Feb 10, 2025
7fc49fe
ensure base styles package is included in built folder
fabiankaegy Feb 10, 2025
a968008
replace instances of `wordpress-admin-schemes` mixin with `wp-admin-s…
fabiankaegy Feb 10, 2025
54d611e
Merge branch 'trunk' into feature/leverage-build-base-styles
fabiankaegy Feb 17, 2025
9b533d6
Update lib/compat/wordpress-6.8/script-loader.php
fabiankaegy Feb 17, 2025
08a7776
Merge branch 'trunk' into feature/leverage-build-base-styles
fabiankaegy Jun 5, 2025
53bacb4
move to 6.9 folder
fabiankaegy Jun 5, 2025
3fa808e
add backport link
fabiankaegy Jun 5, 2025
757f548
Merge branch 'trunk' into feature/leverage-build-base-styles
fabiankaegy Nov 26, 2025
8095112
fix update path
fabiankaegy Nov 26, 2025
63f03bc
remove css import from commands styles
fabiankaegy Nov 26, 2025
e4e44f2
fix update paths
fabiankaegy Nov 26, 2025
4691992
fix remove redundant overrided
fabiankaegy Nov 26, 2025
51db664
further simplify
fabiankaegy Nov 26, 2025
25d42a4
fix package config for new build system
fabiankaegy Nov 26, 2025
78b83d8
fix style url
fabiankaegy Nov 26, 2025
b94eb51
fix load base styles for block-library
fabiankaegy Nov 26, 2025
d77918a
fix move styles
fabiankaegy Nov 26, 2025
141927d
Merge branch 'trunk' into feature/leverage-build-base-styles
fabiankaegy Nov 26, 2025
b07676a
fix simplify
fabiankaegy Nov 26, 2025
64f77bf
fix add back accidentally removed override
fabiankaegy Nov 26, 2025
0dcec76
Merge branch 'trunk' into feature/leverage-build-base-styles
fabiankaegy Dec 12, 2025
9397ad2
fix, simplify loading of base styles
fabiankaegy Dec 12, 2025
6fceeb2
fix include exports of all source sass files
fabiankaegy Dec 12, 2025
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
3 changes: 3 additions & 0 deletions backport-changelog/6.9/8909.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
https://github.com/WordPress/wordpress-develop/pull/8909

* https://github.com/WordPress/gutenberg/pull/69130
13 changes: 13 additions & 0 deletions lib/client-assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,18 @@ function gutenberg_register_packages_styles( $styles ) {
// wp-customize-widgets: add wp-edit-blocks (custom handle not auto-inferred)
$styles->query( 'wp-customize-widgets', 'registered' )->deps[] = 'wp-edit-blocks';

// Register wp-base-styles and add it to the already registered wp-admin stylesheet
gutenberg_override_style(
$styles,
'wp-base-styles',
gutenberg_url( 'build/styles/base-styles/admin-schemes.css' ),
array(),
$version
);
$styles->add_data( 'wp-base-styles', 'rtl', 'replace' );
$styles->add_data( 'wp-base-styles', 'path', gutenberg_dir_path() . 'build/styles/base-styles/admin-schemes.css' );
$styles->query( 'wp-admin', 'registered' )->deps[] = 'wp-base-styles';
Comment thread
fabiankaegy marked this conversation as resolved.

gutenberg_override_style(
$styles,
'wp-block-editor-content',
Expand Down Expand Up @@ -181,6 +193,7 @@ function gutenberg_register_packages_styles( $styles ) {
// Until #37466, we can't specifically add them as editor styles yet,
// so we must hard-code it here as a dependency.
'wp-block-editor-content',
'wp-base-styles',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It feels a bit weird to me that this is added to the blocks editor styles. Logically, it seems better to add as a dependency to all the scripts that do React.render instead (top level scripts like edit-post, edit-site, ...)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The user color scheme must be respected even within an iframe. For example, a block may have form elements.

image

So we added a style to it. Is there a better way?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think that's ok, but how are we adding this dependency to the "top level" packages. I think it's not a guarantee that these top packages will depend on "blocks", especially if we start lazy-loading the editor for instance in the site editor.

Anyway, not a huge deal for now as long as it works :)

);

// Only load the default layout and margin styles for themes without theme.json file.
Expand Down
18 changes: 18 additions & 0 deletions packages/base-styles/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,24 @@
"node": ">=18.12.0",
"npm": ">=8.19.2"
},
"main": "index.js",
"module": "index.js",
"exports": {
"./package.json": "./package.json",
"./build-style/": "./build-style/",
"./_*.scss": "./_*.scss",
"./animations": "./_animations.scss",
"./breakpoints": "./_breakpoints.scss",
"./colors": "./_colors.scss",
"./colors.native": "./_colors.native.scss",
"./default-custom-properties": "./_default-custom-properties.scss",
"./functions": "./_functions.scss",
"./long-content-fade": "./_long-content-fade.scss",
"./mixins": "./_mixins.scss",
"./variables": "./_variables.scss",
"./z-index": "./_z-index.scss"
},
"wpScript": true,
Comment thread
fabiankaegy marked this conversation as resolved.
"publishConfig": {
"access": "public"
}
Expand Down
4 changes: 0 additions & 4 deletions packages/block-editor/src/content.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,3 @@
@use "./components/plain-text/content.scss" as *;
@use "./components/rich-text/content.scss" as *;
@use "./components/warning/content.scss" as *;

// To do: ideally the iframe does not contain UI, but there's still the block
// placeholders that will be moved to shadow DOM in the future.
@include wordpress-admin-schemes();
2 changes: 0 additions & 2 deletions packages/block-editor/src/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,3 @@
@use "./components/block-toolbar/style.scss" as *;
@use "./components/inserter/style.scss" as *;
@use "./components/spacing-sizes-control/style.scss" as *;

@include wordpress-admin-schemes();
2 changes: 0 additions & 2 deletions packages/commands/src/style.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
@use "@wordpress/base-styles/default-custom-properties" as *;
@use "@wordpress/base-styles/mixins" as *;
@use "./components/style.scss" as *;

@include wordpress-admin-schemes();
2 changes: 0 additions & 2 deletions packages/edit-post/src/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,3 @@ body.js.block-editor-page {
height: auto;
}
}

@include wordpress-admin-schemes();
2 changes: 0 additions & 2 deletions packages/edit-site/src/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -89,5 +89,3 @@ body.js.site-editor-php {
top: 0;
}
}

@include wordpress-admin-schemes();
2 changes: 0 additions & 2 deletions packages/edit-widgets/src/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,3 @@ body.js.widgets-php {
.js .widgets-php .notice {
display: none !important;
}

@include wordpress-admin-schemes();
2 changes: 0 additions & 2 deletions packages/list-reusable-blocks/src/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,3 @@
position: relative;
top: -3px;
}

@include wordpress-admin-schemes();
Loading