Repository navigation
Leverage @wordpress/base-styles admin schemes stylesheet instead of duplicate declarations in various packages #69130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
a71c91a
83ea0b4
7fc49fe
a968008
54d611e
9b533d6
08a7776
53bacb4
3fa808e
757f548
8095112
63f03bc
e4e44f2
4691992
51db664
25d42a4
78b83d8
b94eb51
d77918a
141927d
b07676a
64f77bf
0dcec76
9397ad2
6fceeb2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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'; | ||
|
|
||
| gutenberg_override_style( | ||
| $styles, | ||
| 'wp-block-editor-content', | ||
|
|
@@ -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', | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. | ||
|
|
||
| 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(); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -49,5 +49,3 @@ body.js.block-editor-page { | |
| height: auto; | ||
| } | ||
| } | ||
|
|
||
| @include wordpress-admin-schemes(); | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -89,5 +89,3 @@ body.js.site-editor-php { | |
| top: 0; | ||
| } | ||
| } | ||
|
|
||
| @include wordpress-admin-schemes(); | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,5 +8,3 @@ | |
| position: relative; | ||
| top: -3px; | ||
| } | ||
|
|
||
| @include wordpress-admin-schemes(); | ||

Uh oh!
There was an error while loading. Please reload this page.