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

Make buttons 40px high including box shadow #416

Merged
merged 3 commits into from
Jan 9, 2018
Merged

Conversation

36degrees
Copy link
Contributor

@36degrees 36degrees commented Jan 9, 2018

Because the shadow is visually 'part of' the button, we need to reduce the height of the button to compensate by adjusting its padding and increase the bottom margin to include it.

We also fix the line height at 40px which means that whilst the button font size reduces on a mobile breakpoint, the height of the element remains the same. This means that when we remove the use of em for the inputs we will end up with inputs and buttons having a consistent height of 40px at all breakpoints.

Until the use of em for inputs is removed, this currently looks worse on mobile because the inputs become shorter but the button now does not.

Desktop

Before

screen shot 2018-01-09 at 09 55 27

After

screen shot 2018-01-09 at 09 56 08

Mobile

Before

screen shot 2018-01-09 at 09 55 38

After

screen shot 2018-01-09 at 09 56 00

https://trello.com/c/03CyckKm/488-correct-button-height

This corrects the button height to 40px including the shadow, which means it lines up correctly with other form components.
Because the shadow is considered 'part of' the button but is actually included as part of the margin, we need to increase the bottom margin to compensate.

This also adds a comment to try and explain what on earth is going on.
This ensures that the button will be 40px high at all breakpoints, whilst the font size only (of the button's text) will be reduced on mobile.
@NickColley
Copy link
Contributor

How should the buttons align? At the moment they're different height to the input, is that intended?

@36degrees
Copy link
Contributor Author

They should align on desktop and mobile, but at the minute they only align on desktop. Mobile will follow once https://trello.com/c/WpPKyqxl/493-define-size-of-inputs-etc-in-pixels-rather-than-em is done as inputs and buttons will all be 40px high at all breakpoints.

@36degrees 36degrees merged commit bad9047 into master Jan 9, 2018
@36degrees 36degrees deleted the fix-button-height branch January 9, 2018 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants