Make WordPress Core

Opened 11 years ago

Closed 11 years ago

#29493 closed defect (bug) (fixed)

Media Frames: Checkboxes/Radio buttons should get box-sizing: border-box

Reported by: ocean90's profile ocean90 Owned by: mlteal's profile mlteal
Milestone: 4.0.1 Priority: normal
Severity: normal Version: 4.0
Component: Media Keywords: good-first-bug has-patch fixed-major
Focuses: ui, administration Cc:

Description

In [29465] we removed box-sizing: border-box from checkboxes and radio buttons in favour of a more general rule, see trunk/src/wp-admin/css/forms.css@29690#L2.

The media frame has a reset rule, which sets box-sizing to content-box, see trunk/src/wp-includes/css/media-views.css?rev=29687#L4. For some input fields we set border-box again, see trunk/src/wp-includes/css/media-views.css?rev=29687#L49. But not for checkboxes and radio buttons, see https://cloudup.com/cMnEjZ0Use7.

Attachments (2)

29493.diff (549 bytes) - added by mlteal 11 years ago.
29493.2.diff (776 bytes) - added by mlteal 11 years ago.

Download all attachments as: .zip

Change History (14)

#1 @ocean90
11 years ago

  • Milestone changed from Awaiting Review to 4.0.1

#2 @azaozz
11 years ago

The media frame has a reset rule, which sets box-sizing to content-box...

Not sure why this was added but seems a bad idea. A lot of styling and JS based calculations of element dimensions work better with box-sizing: border-box.

#3 @nacin
11 years ago

Well, it was designed under content-box. The reset is there for themes.

#4 follow-up: @azaozz
11 years ago

For themes that style the media modal? There is a good reason why all form fields have box-sizing: border-box as default rule in the admin. Breaking that for the media modal (and then re-applying it) isn't good/doesn't make much sense.

Generally any CSS selector that has * is a suspect, pretty much like !important :)

Edit: if you mean when the modal is used on the front-end, that still needs more work. Needs to reset and re-apply all of the admin styles that affect every element in the modal.

Last edited 11 years ago by azaozz (previous) (diff)

#5 in reply to: ↑ 4 @nacin
11 years ago

Replying to azaozz:

Edit: if you mean when the modal is used on the front-end, that still needs more work. Needs to reset and re-apply all of the admin styles that affect every element in the modal.

I did mean that. A full reset was not necessary at the time. For frontend elements like the toolbar or modal, we have always taken a more practical approach to resets.

@mlteal
11 years ago

#6 @mlteal
11 years ago

  • Keywords has-patch added; needs-patch removed

Tested with both checkboxes and radio buttons at the WordCamp LA contributor day.

@mlteal
11 years ago

#7 @mlteal
11 years ago

Actually, after looking at [29465], we should use that approach here too. In this case we should apply it to select elements to override content-box applied to *. We don't do that normally because selects use border-box in the user agent stylesheet. See 29493.2.diff.

#8 @ocean90
11 years ago

In 29727:

Media Frames: Set the box-sizing CSS property to border-box for checkboxes and radio buttons.

props mlteal.
see #29493.

#9 @ocean90
11 years ago

  • Keywords fixed-major added

#10 @nacin
11 years ago

  • Owner set to mlteal
  • Status changed from new to assigned

Assigning this ticket to get it out of the good-first-bugs report.

First props for mlteal :)

#11 @jorbin
11 years ago

Tested and confirmed that r29727 applies cleanly to the 4.0 branch and applies box-sizing: border-box to radio and checkboxes inside the media model.

This is ready to be merged.

#12 @nacin
11 years ago

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

[30262] merges this to 4.0.

Note: See TracTickets for help on using tickets.