-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Allow to identify styles that are added to the editor settings #1326
Changes from all commits
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 |
---|---|---|
|
@@ -285,10 +285,14 @@ function get_block_editor_settings( array $custom_settings, $block_editor_contex | |
$theme_json = WP_Theme_JSON_Resolver::get_merged_data( $editor_settings ); | ||
|
||
if ( WP_Theme_JSON_Resolver::theme_has_support() ) { | ||
$editor_settings['styles'][] = array( 'css' => $theme_json->get_stylesheet( 'block_styles' ) ); | ||
$editor_settings['styles'][] = array( | ||
'css' => $theme_json->get_stylesheet( 'block_styles' ), | ||
'__unstableType' => 'globalStyles', | ||
); | ||
$editor_settings['styles'][] = array( | ||
'css' => $theme_json->get_stylesheet( 'css_variables' ), | ||
'__experimentalNoWrapper' => true, | ||
'__unstableType' => 'globalStyles', | ||
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. "Global styles" has several origins it could be core, theme, and user. Do you think it would make sense/would be useful to also have origin indicators for global styles? It would be complex given how our theme.json merge works. 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 considered it, but the concept of "origin" doesn't match well this use case: |
||
); | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previously when working on presets we used the concept of origins to differentiate presets coming from core vs theme vs user. Styles are all the same type/structure they just have different sources/origins do you think it would make sense to name the property __unstableOrigin.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comment above #1326 (comment) I'd rather keep this as type.