Skip to content

Edit Post: Update PluginBlockSettingsMenuItem to use block-editor class name#14745

Merged
aduth merged 1 commit intomasterfrom
fix/plugin-block-settings-menu-item-classname
Apr 1, 2019
Merged

Edit Post: Update PluginBlockSettingsMenuItem to use block-editor class name#14745
aduth merged 1 commit intomasterfrom
fix/plugin-block-settings-menu-item-classname

Conversation

@aduth
Copy link
Copy Markdown
Member

@aduth aduth commented Apr 1, 2019

Previously: #14420, #14112

This pull request seeks to update a few remaining occurrences of class names which have since been updated from editor- to block-editor- prefix to align with the creation of a new block editor module in #14112.

Aside: This serves as good reaffirmation of why there exists guidelines around class naming specific to modules and in how violations become sources of issue for future maintenance.

Testing instructions:

Verify that custom plugin menu items and groups receive appropriate styles. I tested using the "TinyMCE Advanced" plugin, which includes a custom menu item for "Convert to Blocks".

Future Tasks:

These components should not be applying the class name in the way they are. The changes here are the most conservative resolution to the bug, but I would suggest one of the following future enhancements:

  1. Eliminate the block-editor-block-settings-menu__control class name altogether. If it's assumed to be of type wp.components.MenuItem, then BlockSettingsMenu can simply target that class name (.components-menu-item__button) directly in its own styles.
  2. Abstract components in block-editor which apply the necessary class names, to be used by edit-post and others.

@aduth aduth requested review from swissspidy and youknowriad April 1, 2019 13:45
@aduth aduth requested review from noisysocks and talldan as code owners April 1, 2019 13:45
@aduth aduth added [Type] Bug An existing feature does not function as intended [Package] Edit Post /packages/edit-post labels Apr 1, 2019
@aduth aduth merged commit 88ee4d9 into master Apr 1, 2019
@aduth aduth deleted the fix/plugin-block-settings-menu-item-classname branch April 1, 2019 15:03
@aduth aduth added the [Package] Block editor /packages/block-editor label Apr 1, 2019
@aduth
Copy link
Copy Markdown
Member Author

aduth commented Apr 1, 2019

Follow-up task: #14749

@youknowriad youknowriad added this to the 5.4 (Gutenberg) milestone Apr 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] Block editor /packages/block-editor [Package] Edit Post /packages/edit-post [Type] Bug An existing feature does not function as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants