Make WordPress Core

Opened 8 years ago

Closed 8 years ago

#38660 closed defect (bug) (fixed)

Customizer: Edit shortcuts buttons: consider to don't use flexbox

Reported by: afercia's profile afercia Owned by: sirbrillig's profile sirbrillig
Milestone: 4.7 Priority: normal
Severity: normal Version: 4.7
Component: Customize Keywords: has-screenshots has-patch commit
Focuses: Cc:

Description

Testing the new edit shortcut buttons in IE 11, the positioning of the icons is a bit off (red background is just for testing purposes):

https://cldup.com/PDpHWb6fo5.jpg

I'd consider to don't use flexbox at all, and use a more traditional layout model instead.

Is there really the need to use flexbox? browsers already horizontally center anything inside buttons.
About vertical centering, the buttons and icons have fixed width so it's just a matter of ensuring the buttons have always box-sizing: border-box and then use padding: 3px

Attachments (4)

38660.patch (397 bytes) - added by MarcosAlexandre 8 years ago.
388660.patch
38660.diff (423 bytes) - added by MarcosAlexandre 8 years ago.
388660.diff
38660.2.diff (1.3 KB) - added by sirbrillig 8 years ago.
Replace flexbox shortcut icon position with padding
38660.3.diff (1.8 KB) - added by MarcosAlexandre 8 years ago.
Displays menu edit button on monitors with resolution of 1280x1024

Download all attachments as: .zip

Change History (15)

@MarcosAlexandre
8 years ago

388660.patch

@MarcosAlexandre
8 years ago

388660.diff

#1 @mariovalney
8 years ago

  • Keywords has-patch added

#2 @westonruter
8 years ago

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

#3 @sirbrillig
8 years ago

Thanks for the patch @MarcosAlexandre! Can you describe what those changes do?

#4 @sirbrillig
8 years ago

@afercia I'm having trouble getting IE set up to test this properly but I have created a PR to replace flexbox here: https://github.com/xwp/wordpress-develop/pull/197 It seems to work well in Mac OS Safari, Firefox, and Chrome.

I will attach a patch version of the PR here. If you have a moment could you try it out and see how it looks in IE?

@sirbrillig
8 years ago

Replace flexbox shortcut icon position with padding

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


8 years ago

@MarcosAlexandre
8 years ago

Displays menu edit button on monitors with resolution of 1280x1024

#6 @MarcosAlexandre
8 years ago

Hello @sirbrillig, my patch did not remove flexbox, I had changed the margin only, sorry. I tested your patch and it works correctly in IE, Safari, Chrome, Firefox and Opera for Windows. I made 2 more adjustments in CSS because as you can see in the images (https://cloudup.com/i98lTQUb9Yx and https://cloudup.com/i9IMRNkhX6L), the menu edit button, in monitor with resolution of 1280x1024px, was hidden. In addition I also changed the top and left of the header edit button.

Last edited 8 years ago by MarcosAlexandre (previous) (diff)

#7 @sirbrillig
8 years ago

@MarcosAlexandre Nice! Thank you.

the menu edit button, in monitor with resolution of 1280x1024px, was hidden.

Do you mean that it is cut off on the edge of the viewport? If so, I think that's better addressed in #38651. In my opinion bringing the icons closer to their elements looks worse for elements like the site title and tagline. It is a challenging issue, and one that we should explore thoroughly, but I don't think it should block this issue (removing flexbox).

#8 @Fencer04
8 years ago

@sirbrillig I tested the patch from @MarcosAlexandre in IE11 and it appears that the icons are centered. I also think that, at least for Twenty Seventeen, the locations are appropriate enough to let people know what is going to be edited.

The only issue I saw was if you go down to the mobile sizes the menu icon is hidden partially on the left
and not close to where the menu is. That being said I don't think it's a huge deal. It depends on how picky we want to get. This happens in Chrome and IE11. I'm guessing it will happen in all browsers as well.

#9 @afercia
8 years ago

  • Keywords commit added

@sirbrillig just tested 38660.2.diff in IE11 and looks good to me, see below:

https://cldup.com/BJ3unyrK84.png

@Fencer04 @MarcosAlexandre thanks! Had a look at 38660.3.diff and it misses a px unit for the padding, not a big deal just a typo but also I'd agree the icons position is better addressed in #38651 so I'd recommend to commit 38660.2.diff

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


8 years ago

#11 @westonruter
8 years ago

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

In 39186:

Customize: Eliminate use of flexbox for edit shortcuts.

Props sirbrillig.
See #27403.
Fixes #38660.

Note: See TracTickets for help on using tickets.