Make WordPress Core

Opened 7 years ago

Closed 7 years ago

#42101 closed defect (bug) (fixed)

Gallery widget: remove background

Reported by: melchoyce's profile melchoyce Owned by: melchoyce's profile melchoyce
Milestone: 4.9 Priority: normal
Severity: normal Version:
Component: Widgets Keywords: good-first-bug has-patch
Focuses: ui Cc:

Description

The gallery widget has accidentally inherited the grey background from the image widget. (See screenshot) We should remove it.

Attachments (5)

gallery-background.png (314.8 KB) - added by melchoyce 7 years ago.
42101.diff (360 bytes) - added by mrasharirfan 7 years ago.
Limited background color to the Image Widget.
42101-edges-aligned.diff (516 bytes) - added by benoitchantre 7 years ago.
Transparent background, edges aligned
42101.2.diff (845 bytes) - added by Presskopp 7 years ago.
42101.3.diff (1.1 KB) - added by Presskopp 7 years ago.

Download all attachments as: .zip

Change History (22)

#1 @joemcgill
7 years ago

Heh. I had noticed, but thought this was an intentional change.

@mrasharirfan
7 years ago

Limited background color to the Image Widget.

#2 @mrasharirfan
7 years ago

Hey @melchoyce

I just limited the background color to the Image Widget 🙂

https://i.imgur.com/Y9dFQPa.png

Cheers!

#3 @westonruter
7 years ago

I also thought the gray was intentional. I like it that way, IMHO.

#4 @mrasharirfan
7 years ago

True. Without the background color, the pictures are looking a little misaligned from the corners.

#5 @melchoyce
7 years ago

Can we remove whatever padding is causing it to be narrower than the title field?

#6 @mrasharirfan
7 years ago

I am not sure because the padding is coming from each side of the image. I will try to work on it to see if I can find an elegant solution.

#7 @Presskopp
7 years ago

You could just strip any padding here:

.media-widget-gallery-preview .gallery-item

so there will be no borders at all. Looks better at the edges, but doesn't separate the images, see https://core.trac.wordpress.org/ticket/42101#comment:3

#8 follow-up: @melchoyce
7 years ago

We definitely want separation between the images, it'd just be nice to have the edges aligned. I know this is a general issue with galleries. If it's not possible to fix, we can just remove the background color and leave the alignment uneven.

@benoitchantre
7 years ago

Transparent background, edges aligned

#9 in reply to: ↑ 8 @benoitchantre
7 years ago

  • Keywords has-patch added; needs-patch removed

Replying to melchoyce:

We definitely want separation between the images, it'd just be nice to have the edges aligned. I know this is a general issue with galleries. If it's not possible to fix, we can just remove the background color and leave the alignment uneven.

It's possible to fix that using a negative margin. I have added a patch.

#10 @Presskopp
7 years ago

Thanks for inspiration, @benoitchantre , made another patch based on it.

@Presskopp
7 years ago

This ticket was mentioned in Slack in #core by presskopp. View the logs.


7 years ago

#12 @melchoyce
7 years ago

Tested 42101.2.diff.

When the widget is wider than the thumbnails, there's still spacing around the outside edge of the gallery, but I think that's actually fine. Not sure it's worth trying to be 100% perfect here. Screenshots: https://cloudup.com/cxf6sfOM534

However, I did notice an issue on Firefox, where there's no spacing between the rows: https://cloudup.com/cn_qZ7vakXr

I tried testing in Safari, but for some reason it wouldn't show me the patched version at all. :/ So if someone could test that, I'd appreciate it. Would also appreciate a quick IE check.

@Presskopp
7 years ago

#13 @Presskopp
7 years ago

Here's another patch introducing a margin for firefox. Tested now in Chrome, Firefox & Internet Explorer to be ok, while not shown consistently across the browsers. I made sure the grey background is there when you didn't select an element.

The spacing when you have 2n elements is still there, I found it feasible like this.

Sorry no screenshots.

#14 @melchoyce
7 years ago

I think the margin-bottom: 5px; has introduced extra space in Chrome now. Is there maybe a different approach we could take here?

#15 @Presskopp
7 years ago

You're right, that's why I said it's 'ok', not perfect. My abilities to make a cross browser patch are wearing out, good luck, next one! I'm happy if you didn't find more issues at this point

This ticket was mentioned in Slack in #core by melchoyce. View the logs.


7 years ago

#17 @melchoyce
7 years ago

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

In 41833:

Gallery Widget: Remove grey background behind gallery, and align images to the edge of the container.

Props Presskopp, benoitchantre, mrasharirfan.
Fixes #42101.

Note: See TracTickets for help on using tickets.