Make WordPress Core

Opened 11 years ago

Closed 11 years ago

#27045 closed enhancement (fixed)

Gallery css should use box-sizing

Reported by: clorith's profile Clorith Owned by: nacin's profile nacin
Milestone: 3.9 Priority: normal
Severity: normal Version: 3.8
Component: Gallery Keywords: needs-patch
Focuses: Cc:

Description

The gallery CSS should include box-sizing: border-box; to account for people adding padding, borders and such to images, as the current approach of setting percentage based widths does not play well in such situations.

Attachments (1)

27045.patch (369 bytes) - added by Clorith 11 years ago.

Download all attachments as: .zip

Change History (17)

@Clorith
11 years ago

#1 @SergeyBiryukov
11 years ago

  • Keywords has-patch added
  • Milestone changed from Awaiting Review to 3.9
  • Version changed from trunk to 3.8

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


11 years ago

#3 @obenland
11 years ago

Interesting, is there an example of a theme in the repository where the current way presents a problem? Wouldn't theme authors account for borders and paddings with additional styles?

#4 @celloexpressions
11 years ago

The current approach to the gallery styles seems generally wrong, and border-box might sidestep the problem. As obenland said, custom styles should account for these issues themselves, and this change would probably break back-compatibility.

Related: #17142.

#5 @Clorith
11 years ago

Back-compat is a very good point, but it still seems strange to enforce a percentage based size on them, as well as adding paddings and borders, without box-sizing it in core in my opinion.

#6 @cramdesign
11 years ago

Rather than outputting border-box, which I agree is needed for percentage based layout, how about outputting zero css? I know it is easily filtered out but it seems that this is theme territory, not core. Well structured html and a few intelligent classes is all core should be concerned with.

#7 @Clorith
11 years ago

  • Keywords close added

If we were to rip out the styling, we'd also have issues with backwards compatibility I fear, with themes not accounting for all the styles that core already puts in.

I suspect this is one of those "we can't really change it now" cases, and it will have to remain the way it is for everyones sake.

#8 @cramdesign
11 years ago

Well, this really gets into what you consider compatibility. After all, the correct data would still output, classes and tags intact. Styles would be missing, that is all. Not broken. Just different.

#9 follow-up: @obenland
11 years ago

  • Focuses ui template removed
  • Keywords has-patch close removed
  • Milestone 3.9 deleted
  • Resolution set to wontfix
  • Status changed from new to closed

I don't think we can make a change here that will not break backwards compatibility. And that includes visual consistency.

#10 in reply to: ↑ 9 @DrewAPicture
11 years ago

Replying to obenland:

I don't think we can make a change here that will not break backwards compatibility. And that includes visual consistency.

It occurs to me that we could roll in box-sizing as a feature with the new HTML5 option you had merged successfully a couple of days ago. This would get us around back-compat concerns (in a way).

#11 follow-ups: @cramdesign
11 years ago

Hmm... seems a shame to be stuck with this. Perhaps the new HTML5 option could also return false on the "use_default_gallery_style". If a theme author knows to add the new HTML5 option for the gallery they would likely be aware of the output expected including the fact that the default styles are no longer output.

#12 in reply to: ↑ 11 ; follow-up: @nacin
11 years ago

  • Milestone set to 3.9
  • Resolution wontfix deleted
  • Status changed from closed to reopened

Replying to cramdesign:

Hmm... seems a shame to be stuck with this. Perhaps the new HTML5 option could also return false on the "use_default_gallery_style". If a theme author knows to add the new HTML5 option for the gallery they would likely be aware of the output expected including the fact that the default styles are no longer output.

This is a fantastic point and a good opportunity to consider this.

#13 in reply to: ↑ 12 @cramdesign
11 years ago

Replying to nacin:

This is a fantastic point and a good opportunity to consider this.

Great. Do I need to do something? Open a ticket? (Sorry I don't know.)

#14 in reply to: ↑ 11 @lancewillett
11 years ago

Replying to cramdesign:

Hmm... seems a shame to be stuck with this. Perhaps the new HTML5 option could also return false on the "use_default_gallery_style". If a theme author knows to add the new HTML5 option for the gallery they would likely be aware of the output expected including the fact that the default styles are no longer output.

Yes! Love this approach.

#15 @helen
11 years ago

  • Keywords needs-patch added

#16 @nacin
11 years ago

  • Owner set to nacin
  • Resolution set to fixed
  • Status changed from reopened to closed

In 27396:

Do not output default gallery styles if the theme has opted into HTML5 galleries.

fixes #27045. see #26697.

Note: See TracTickets for help on using tickets.