Opened 11 years ago
Closed 11 years ago
#27045 closed enhancement (fixed)
Gallery css should use box-sizing
Reported by: |
|
Owned by: |
|
---|---|---|---|
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)
Change History (17)
#1
@
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
#4
@
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
@
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
@
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
@
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
@
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:
↓ 10
@
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
@
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:
↓ 12
↓ 14
@
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:
↓ 13
@
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
@
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
@
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.
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?