WordPress.org

Make WordPress Core

Opened 13 days ago

Closed 27 hours ago

#42118 closed defect (bug) (fixed)

Twenty Seventeen: Double bottom-margins appear below embeds

Reported by: westonruter Owned by: davidakennedy
Milestone: 4.9 Priority: normal
Severity: normal Version: 4.7
Component: Bundled Theme Keywords: has-patch
Focuses: Cc:

Description

There is some CSS in Twenty Seventeen to make sure embeds and iframes fit their containers:

embed,
iframe,
object {
        margin-bottom: 1.5em;
        max-width: 100%;
}

However, in the case of an oEmbed where a video appears inside of its own paragraph the result is a double margin between the iframe and the next paragraph. The margin should only be added if the iframe is the only child of the parent element.

This is a problem both for videos in post content and for videos embedded into the Text widget via #40854.

Attachments (2)

extra-margin.png (606.5 KB) - added by westonruter 13 days ago.
42118.0.diff (520 bytes) - added by westonruter 13 days ago.

Download all attachments as: .zip

Change History (6)

@westonruter
13 days ago

#1 @westonruter
13 days ago

  • Keywords has-patch added
  • Owner set to westonruter
  • Status changed from new to reviewing
  • Version set to 4.7

#2 @westonruter
13 days ago

  • Owner changed from westonruter to davidakennedy

#3 @davidakennedy
28 hours ago

Tested this. I can confirm the bug, and the patch looks good to me. Thanks @westonruter!

#4 @davidakennedy
27 hours ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 41888:

Twenty Seventeen: Fix double bottom-margins below embeds

Corrects an issue where both the containing paragraph and embed had bottom margins, causing unwanted extra space.

Props westonruter.

Fixes #42118.

Note: See TracTickets for help on using tickets.