Skip to content

Commit

Permalink
Add variable font size for input display on iOS
Browse files Browse the repository at this point in the history
  • Loading branch information
mrtuvn committed Feb 23, 2021
1 parent 2e2af0a commit 3a07a28
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@
}

input {
font-size: 16px;
left: -300%;
margin: 15px 0;
position: absolute;
Expand Down Expand Up @@ -188,6 +187,10 @@
.block-content {
margin-bottom: 0;
}

input {
font-size: @form-element-input-mobile__font-size;
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@
}

input {
font-size: 16px;
left: -300%;
margin: 15px 0;
position: absolute;
Expand Down Expand Up @@ -215,6 +214,10 @@
.media-width(@extremum, @break) when (@extremum = 'max') and (@break = @screen__m) {
.block-search {
margin-top: @indent__s;

input {
font-size: @form-element-input-mobile__font-size;
}
}
}

Expand Down
5 changes: 5 additions & 0 deletions lib/web/css/source/lib/variables/_forms.less
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@
@form-element-input__vertical-align: baseline;
@form-element-input__background-clip: padding-box; // [border-box|content-box|padding-box]
@form-element-input__font-size: @font-size__base;

// On iOS the search input has to be at least 16px large,
// otherwise it will needlessly trigger page zoom once the input is focused.
@form-element-input-mobile__font-size: 1.6rem;

@form-element-input__color: false;
@form-element-input__font-family: @font-family__base;
@form-element-input__font-weight: false;
Expand Down

0 comments on commit 3a07a28

Please sign in to comment.