Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Align timepicker to calendar #7864

Merged
merged 1 commit into from
Aug 1, 2018
Merged

Align timepicker to calendar #7864

merged 1 commit into from
Aug 1, 2018

Conversation

sarahmonster
Copy link
Member

@sarahmonster sarahmonster commented Jul 10, 2018

Description

At tablet-ish screen sizes, the calendar in the pre-publish panel is aligned to the left of the panel, whilst the timepicker attached to it floats way out in the middle of the screen, making them seem disconnected. Adding a max-width to the timepicker solves this issue and doesn't seem to break when using different languages, zoom levels, or font sizes.

Fixes #7863.

How has this been tested?

Tested in Chrome/Firefox on a Mac, in English, Hebrew, and Japanese (and at varying levels of zoom and font sizes).

Before:

screenshot 2018-07-09 20 23 47

After:

screenshot 2018-07-10 12 59 32

Types of changes

Simple bug fix.

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.

@sarahmonster sarahmonster requested a review from a team July 19, 2018 12:31
Copy link
Member

@tofumatt tofumatt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works for me, just a note about using a variable if that width is related to anything else.

@@ -43,6 +43,7 @@ $datepicker__border-color: $light-gray-500;
align-items: center;
justify-content: center;
margin-top: 10px;
max-width: 248px;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this size picked? Is it the max-width of the datepicker itself? If so, we should use a variable.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's just a (manually calculated) width of the calendar itself, which doesn't seem to change at all. The number isn't used elsewhere, so whilst we could add a variable for it, I'm not sure we'd ever need/want to use it elsewhere.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense; a comment explaining that would be great, in that case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] UI Components Impacts or related to the UI component system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pre-publish panel calendar and timepicker are misaligned at certain breakpoints
3 participants