Skip to content
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

Custom styles of core/group invisible in editor #20140

Closed
aartjan opened this issue Feb 10, 2020 · 1 comment · Fixed by #20164
Closed

Custom styles of core/group invisible in editor #20140

aartjan opened this issue Feb 10, 2020 · 1 comment · Fixed by #20164
Assignees
Labels
[Block] Group Affects the Group Block (and row, stack and grid variants) [Status] In Progress Tracking issues with work in progress [Type] Regression Related to a regression in the latest release

Comments

@aartjan
Copy link

aartjan commented Feb 10, 2020

Describe the bug
Before activating the Gutenberg plugin (working in WordPress 5.3.2) I could use JS or PHP to add a custom style to the core/group block and the backend would provide a "is-style-XXX" class to the group. This is still working in the website, but not in the editor when I activate the Gutenberg Plugin.

To reproduce
Steps to reproduce the behavior:
Add this JS:
registerBlockStyle( 'core/group' , { name: 'golden-border', label: __( 'Golden Border' ), });
or this PHP:
register_block_style( 'core/group', [ 'name' => 'golden-border', 'label' => 'Golden Border', 'style_handle' => 'block-styles-stylesheet', ] );
to a theme, without installing Gutenberg Plugin.
Add this to the stylesheet of the theme
.wp-block-group.is-style-golden-border { border: 2px solid #caa071; (...) }
Add this to the theme:
add_theme_support( 'editor-styles' );

Expected behavior
Both in the website and in the editor a 2px border should appear around the group if I select the style for a group. This happens if I disable the plugin, but with the plugin enabled, the is-style-golden-border class is gone.

Screenshots
Fragments of editor with Gutenberg plugin disabled
Schermafbeelding 2020-02-10 om 15 11 34
Schermafbeelding 2020-02-10 om 15 16 45

Fragments of editor with Gutenberg plugin enabled
Schermafbeelding 2020-02-10 om 15 11 50
Schermafbeelding 2020-02-10 om 15 17 12

Fragment of the website (identical in both cases)
Schermafbeelding 2020-02-10 om 15 11 59

Desktop (please complete the following information):

  • OS: OSX Catalina
  • Browser Chrome
  • Version 79

Additional context

  • Gutenberg plugin 7.4.0
@talldan
Copy link
Contributor

talldan commented Feb 11, 2020

@aartjan Thanks for reporting the issue. I can confirm the bug. Looks like it's caused by this change:
https://github.com/WordPress/gutenberg/pull/19181/files#diff-d819635dc4c6f7b9326773f5726a37b7R36

I'll work on a fix for this.

@talldan talldan added [Block] Group Affects the Group Block (and row, stack and grid variants) [Type] Regression Related to a regression in the latest release labels Feb 11, 2020
@talldan talldan self-assigned this Feb 11, 2020
@talldan talldan added the [Status] In Progress Tracking issues with work in progress label Feb 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Group Affects the Group Block (and row, stack and grid variants) [Status] In Progress Tracking issues with work in progress [Type] Regression Related to a regression in the latest release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants