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

Add styles to stop classic block editor buttons from inheriting italics from themes #11132

Merged
merged 1 commit into from
Oct 29, 2018
Merged

Add styles to stop classic block editor buttons from inheriting italics from themes #11132

merged 1 commit into from
Oct 29, 2018

Conversation

laurelfulford
Copy link
Contributor

Description

When a theme includes style for the i tag in the classic editor CSS, and that stylesheet is pulled into Gutenberg via add_theme_support( 'editor-styles' ), it can cause the buttons in the classic block to be italicized. This is because the classic editor styles are added inline, overriding the font-style: normal added to the .mce-ico class in the TinyMCE styles.

Admittedly, this is kind of an odd case -- the i tag is deprecated in the HTML spec, and is usually used for icons because of that: it's usually not styled. But since the default themes are built with backwards compatibility in mind, most do include some reset styles for this tag. And because of the nature of default themes, how they do this is often copied as a best practice for other themes.

This issue was brought up in #11034, and was moved to be a default theme issue (https://core.trac.wordpress.org/ticket/45188) because it seemed specific to Twenty Seventeen. It turns out it's present in all older default themes but Twenty Thirteen.

Screenshots

Before (from #11034):

twenty-seventeen-editor-buttons

After:

twenty-seventeen-editor-buttons-after

Types of changes

This change updates CSS, to reiterate some styles already present in Gutenberg, but with a more specific selector so they can't be overwritten by something inline.

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.

…s from themes. Specifically in cases where a theme's original editor styles do something with the i tag; since these are added inline, they also add italicized styles to the classic editor block buttons.
Copy link
Contributor

@youknowriad youknowriad left a comment

Choose a reason for hiding this comment

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

LGTM 👍 Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants