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

'col-form-label' does not vertical align properly #24328

Closed
robvaneck opened this issue Oct 10, 2017 · 3 comments
Closed

'col-form-label' does not vertical align properly #24328

robvaneck opened this issue Oct 10, 2017 · 3 comments
Labels

Comments

@robvaneck
Copy link

npm installed boostrap
"bootstrap": "^4.0.0-beta",

issue
Vertical alignment of the 'col-form-label' is off.

TL;DR;
Why? Because the form-control has no fixed height... thus 'border-box' has no impact when adding borders.. > the borders add to the total height. So: 2px border on the input will add +4px instead of going inside. E.g. 44px vs 40px without borders. But if the input would have had height 40px.. then border-box would have done it's job and added the 2* 2px border inside those 40px.. this is not the case atm.

So the calculation of the 'col-form-label' is wrong (when there is no height on the form-control):

_forms.scss line 93
padding-top: calc(#{$input-btn-padding-y} - #{$input-btn-border-width} * 2); padding-bottom: calc(#{$input-btn-padding-y} - #{$input-btn-border-width} * 2);
it has the opposite effect to substract "#{$input-btn-border-width} * 2);"

solution
padding-top: input-btn-padding-y; padding-bottom: $input-btn-padding-y;

@wojtask9
Copy link
Contributor

should be fixed in #23121

@robvaneck
Copy link
Author

Thank you! And for this Bootstrap, it's awesome

@andresgalante
Copy link
Collaborator

@borriej thanks for reporting it.

This can be also done by align-items: center the form-group or align-self: center .col-form-label instead of so much maths.

I'll take a look at that and close this issue since it's solved by #23121

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants