Make WordPress Core

Opened 10 years ago

Closed 10 years ago

#28681 closed defect (bug) (fixed)

Removes Margin from Editor Style as it overrides CSS in editor style

Reported by: rdall's profile RDall Owned by: azaozz's profile azaozz
Milestone: 4.0 Priority: normal
Severity: normal Version: 3.9
Component: TinyMCE Keywords: has-patch
Focuses: Cc:

Description

The align center in the editor style wasn't working because their was a line of style in the wp-content.css that was overriding all editor styles.

This should be handled by the editor style and not the TinyMCE style.

Attachments (2)

28048.diff (428 bytes) - added by RDall 10 years ago.
emoves Margin and Padding from TinyMCE style editor
28681.diff (466 bytes) - added by obenland 10 years ago.

Download all attachments as: .zip

Change History (17)

@RDall
10 years ago

emoves Margin and Padding from TinyMCE style editor

#1 @SergeyBiryukov
10 years ago

  • Keywords has-patch commit added
  • Milestone changed from Awaiting Review to 4.0

Makes sense to me.

#3 @iseulde
10 years ago

  • Component changed from Editor to TinyMCE

This ticket was mentioned in IRC in #wordpress-dev by RDall. View the logs.


10 years ago

#5 @obenland
10 years ago

RDall, could you attache before/after screenshots to this ticket?
Which theme's editor stylesheet didn't work?

#6 @RDall
10 years ago

Hi Obenland It was Twenty Thirteen I was working on when I saw this and I was with Aaron Jorbin at WCSEA contributor day when I saw the issue. He suggested that the style wasn't being applied because it was being overridden by style in the include file.

I will attach screenshots shortly.

#7 @RDall
10 years ago

Screenshots:

Post view of image:
http://cl.ly/image/2m211q3G3l0a

Editor view before:
http://cl.ly/image/2s3S1u1O1A1J

And with the patch applied:
http://cl.ly/image/013l0D1n1x0u

#8 follow-up: @obenland
10 years ago

  • Component changed from TinyMCE to Bundled Theme
  • Focuses template removed
  • Keywords has-patch commit removed

Okay, that's a Twenty Thirteen bug then, where the editor styles need to be more specific.
A center-aligned caption in _s and Twenty Fourteen is center aligned.

#9 @RDall
10 years ago

How would you add more weight to the editor style css then? Without using the dreaded !important.

I did find the bug… but Jobin suggested the patch… So I am somewhat at a loss of how to override something core doesn't want to override in a theme…

Suggestions welcome :-)

#10 in reply to: ↑ 8 ; follow-up: @SergeyBiryukov
10 years ago

Replying to obenland:

Okay, that's a Twenty Thirteen bug then, where the editor styles need to be more specific.
A center-aligned caption in _s and Twenty Fourteen is center aligned.

We had to fix it for Twenty Fourteen in [28941]. Twenty Thirteen doesn't have that style and uses the default one.

I think the point of this ticket is that center-aligned images with captions should be displayed correctly in TinyMCE regardless of the theme. Currently, .html5-captions .wp-caption { margin: 0; } in default styles overrides .aligncenter { margin-left: auto; margin-right: auto; }.

#11 @RDall
10 years ago

After looking at the code and trying a few ideas which didn't work as they were still overridden but the tinyMCE file I can whole heartily agree with Serge in comment and Jorbin in his original idea as it should be applied to all themes regardless.

Version 0, edited 10 years ago by RDall (next)

@obenland
10 years ago

#12 in reply to: ↑ 10 @obenland
10 years ago

  • Component changed from Bundled Theme to TinyMCE
  • Keywords has-patch added

Replying to SergeyBiryukov:

We had to fix it for Twenty Fourteen in [28941]. Twenty Thirteen doesn't have that style and uses the default one.

I think the point of this ticket is that center-aligned images with captions should be displayed correctly in TinyMCE regardless of the theme. Currently, .html5-captions .wp-caption { margin: 0; } in default styles overrides .aligncenter { margin-left: auto; margin-right: auto; }.

Bummer we didn't catch that in 3.9 :(

But let's make the selector more specific then, rather than removing the style resets.

#13 @RDall
10 years ago

Patch works for me.

This ticket was mentioned in IRC in #wordpress-dev by RDall. View the logs.


10 years ago

#15 @azaozz
10 years ago

  • Owner set to azaozz
  • Resolution set to fixed
  • Status changed from new to closed

In 29195:

TinyMCE: fix aligncenter for html5-captions, props obenland, fixes #28681.

Note: See TracTickets for help on using tickets.