Make WordPress Core

Opened 5 years ago

Last modified 5 years ago

#49333 new defect (bug)

Image on text section of Media & Text block not displaying on front side

Reported by: ramizmanked's profile ramizmanked Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Editor Keywords:
Focuses: css, administration Cc:

Description

If we enable 'Crop image to fill entire column' option for Media & Text block, Image placed through Image block to the Text section of Media & Text block remains hidden on front end.

Change History (1)

#1 @SavvyK
5 years ago

I just discovered this issue today also and I believe I found the problem. The CSS for this option is being applied to all every figure within the block, not just the one in the media column. The CSS needs to be more specific and use

figure.wp-block-media-text__media

instead of figure.

Two places need changes:

.wp-block-media-text.is-image-fill figure {
    height: 100%;
    min-height: 250px;
    background-size: cover;
}

and

.wp-block-media-text.is-image-fill figure>img {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}

should be:

.wp-block-media-text.is-image-fill figure.wp-block-media-text__media {
    height: 100%;
    min-height: 250px;
    background-size: cover;
}

and

.wp-block-media-text.is-image-fill figure.wp-block-media-text__media>img {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}
Note: See TracTickets for help on using tickets.