1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-20 04:11:39 +02:00

Remove explicit heights on form elements (#31993)

* Remove explicit heights

* Link to upstream bug

Co-authored-by: XhmikosR <xhmikosr@gmail.com>
This commit is contained in:
Martijn Cuppens
2020-10-29 14:18:39 +01:00
committed by GitHub
parent 2bd5ba147b
commit ed1d867dd8
4 changed files with 26 additions and 24 deletions

View File

@@ -5,7 +5,6 @@
.form-control {
display: block;
width: 100%;
min-height: $input-height;
padding: $input-padding-y $input-padding-x;
font-family: $input-font-family;
@include font-size($input-font-size);
@@ -45,6 +44,14 @@
}
}
// Add some height to date inputs on iOS
// https://github.com/twbs/bootstrap/issues/23307
// TODO: we can remove this workaround once https://bugs.webkit.org/show_bug.cgi?id=198959 is resolved
&::-webkit-date-and-time-value {
// Multiply line-height by 1em if it has no unit
height: if(unit($input-line-height) == "", $input-line-height * 1em, $input-line-height);
}
// Placeholder
&::placeholder {
color: $input-placeholder-color;
@@ -180,6 +187,24 @@
}
}
// Make sure textareas don't shrink too much when resized
// https://github.com/twbs/bootstrap/pull/29124
// stylelint-disable selector-no-qualifying-type
textarea {
&.form-control {
min-height: $input-height;
}
&.form-control-sm {
min-height: $input-height-sm;
}
&.form-control-lg {
min-height: $input-height-lg;
}
}
// stylelint-enable selector-no-qualifying-type
.form-control-color {
max-width: 3rem;
padding: $input-padding-y;