WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#27502 closed enhancement (fixed)

Twenty Thirteen and Fourteen: Add support for HTML5 gallery and caption

Reported by: obenland Owned by: lancewillett
Milestone: 3.9 Priority: normal
Severity: normal Version: 3.9
Component: Bundled Theme Keywords: has-patch
Focuses: ui Cc:

Description

HTML5 gallery (r27302) and caption (r27668) markup were introduced in 3.9.
Let's update the two default themes that have added support for some HTML5 features with support for it.

Since both Twenty Thirteen and Twenty Fourteen have custom styles for galleries, adding support to them is rather trivial. Captions need a bit more CSS love to keep them visually consistent.

Backwards compatibility in general should not be a problem, since both themes we developed against the pre-HTML5 output.

Attachments (3)

27502.diff (4.4 KB) - added by obenland 6 years ago.
27502.2.diff (4.4 KB) - added by lancewillett 6 years ago.
Refreshed patch with correct CSS block spacing
27502.3.diff (4.5 KB) - added by obenland 6 years ago.

Download all attachments as: .zip

Change History (9)

@obenland
6 years ago

#1 @obenland
6 years ago

The only (front-end) CSS change necessary for galleries is an added bottom margin for gallery captions in Twenty Thirteen. It used to rely on the p element to add that.

For captions we need some more work since we have to make up for the lost 10px in width. It can mostly be achieved with overriding the selector that defines the margins on aligned caption images.

While working on it I discovered and fixed a visual bug in both themes, where images within right aligned captions were still left aligned within the caption. I added styles to either add a padding left or float it right, so the margin to the text is corrected. See before and after: https://cloudup.com/cBVsdJYVprT

For editor styles I had to reset the padding we added for HTML5 captions both times. So removing caption styles for HTML5 entirely, as azaozz brought up in #26642, might not be the worst idea.

#2 follow-up: @lancewillett
6 years ago

  • Focuses ui added

Isn't it too late for 3.9? Pencils down last Friday, I think.

#3 in reply to: ↑ 2 ; follow-up: @nacin
6 years ago

Replying to lancewillett:

Isn't it too late for 3.9? Pencils down last Friday, I think.

I'm fine with new-feature-support being added to default themes whenever. However, would adding this cause problems with existing custom styles, child themes, etc? I'd love to do this, but it's not a small markup shift.

#4 in reply to: ↑ 3 @obenland
6 years ago

Replying to nacin:

However, would adding this cause problems with existing custom styles, child themes, etc?

Possibly. Captions more likely than galleries. All bets are off when they used element selectors.

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


6 years ago

@lancewillett
6 years ago

Refreshed patch with correct CSS block spacing

@obenland
6 years ago

#6 @lancewillett
6 years ago

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

In 27763:

Twenty Thirteen and Fourteen: implement HTML5 markup for galleries (see #26697) and captions (see #26642). Props obenland, closes #27502.

Note: See TracTickets for help on using tickets.