From 97567e2f91cb4f1d33bee4433493033ddfd6b383 Mon Sep 17 00:00:00 2001 From: Kelly Choyce-Dwan Date: Tue, 22 Dec 2020 17:07:44 +0000 Subject: [PATCH] Twenty Twenty-One: Set a maximum width on inputs. Text inputs with a size attribute can end up longer than the screen width on small screens. A max-width of 100% keeps the inputs from breaking out of the container. Props basscan, kjellr, poena, sabernhardt. Merges [49870] to the 5.6 branch. Fixes #52083. git-svn-id: https://develop.svn.wordpress.org/branches/5.6@49871 602fd350-edb4-49c9-b593-d223f7449a82 --- .../themes/twentytwentyone/assets/css/ie.css | 15 +++++++++++++++ .../assets/sass/04-elements/forms.scss | 1 + .../themes/twentytwentyone/style-rtl.css | 1 + src/wp-content/themes/twentytwentyone/style.css | 1 + 4 files changed, 18 insertions(+) diff --git a/src/wp-content/themes/twentytwentyone/assets/css/ie.css b/src/wp-content/themes/twentytwentyone/assets/css/ie.css index c34188e6d8..0fbabf9b6c 100644 --- a/src/wp-content/themes/twentytwentyone/assets/css/ie.css +++ b/src/wp-content/themes/twentytwentyone/assets/css/ie.css @@ -1475,6 +1475,7 @@ input[type=text] { line-height: 1.7; padding: 10px; margin: 0 2px; + max-width: 100%; } input[type=email] { @@ -1484,6 +1485,7 @@ input[type=email] { line-height: 1.7; padding: 10px; margin: 0 2px; + max-width: 100%; } input[type=url] { @@ -1493,6 +1495,7 @@ input[type=url] { line-height: 1.7; padding: 10px; margin: 0 2px; + max-width: 100%; } input[type=password] { @@ -1502,6 +1505,7 @@ input[type=password] { line-height: 1.7; padding: 10px; margin: 0 2px; + max-width: 100%; } input[type=search] { @@ -1511,6 +1515,7 @@ input[type=search] { line-height: 1.7; padding: 10px; margin: 0 2px; + max-width: 100%; } input[type=number] { @@ -1520,6 +1525,7 @@ input[type=number] { line-height: 1.7; padding: 10px; margin: 0 2px; + max-width: 100%; } input[type=tel] { @@ -1529,6 +1535,7 @@ input[type=tel] { line-height: 1.7; padding: 10px; margin: 0 2px; + max-width: 100%; } input[type=date] { @@ -1538,6 +1545,7 @@ input[type=date] { line-height: 1.7; padding: 10px; margin: 0 2px; + max-width: 100%; } input[type=month] { @@ -1547,6 +1555,7 @@ input[type=month] { line-height: 1.7; padding: 10px; margin: 0 2px; + max-width: 100%; } input[type=week] { @@ -1556,6 +1565,7 @@ input[type=week] { line-height: 1.7; padding: 10px; margin: 0 2px; + max-width: 100%; } input[type=time] { @@ -1565,6 +1575,7 @@ input[type=time] { line-height: 1.7; padding: 10px; margin: 0 2px; + max-width: 100%; } input[type=datetime] { @@ -1574,6 +1585,7 @@ input[type=datetime] { line-height: 1.7; padding: 10px; margin: 0 2px; + max-width: 100%; } input[type=datetime-local] { @@ -1583,6 +1595,7 @@ input[type=datetime-local] { line-height: 1.7; padding: 10px; margin: 0 2px; + max-width: 100%; } input[type=color] { @@ -1592,6 +1605,7 @@ input[type=color] { line-height: 1.7; padding: 10px; margin: 0 2px; + max-width: 100%; } .site textarea { @@ -1601,6 +1615,7 @@ input[type=color] { line-height: 1.7; padding: 10px; margin: 0 2px; + max-width: 100%; } input[type=text]:focus { diff --git a/src/wp-content/themes/twentytwentyone/assets/sass/04-elements/forms.scss b/src/wp-content/themes/twentytwentyone/assets/sass/04-elements/forms.scss index 08880c830f..6e734aae29 100644 --- a/src/wp-content/themes/twentytwentyone/assets/sass/04-elements/forms.scss +++ b/src/wp-content/themes/twentytwentyone/assets/sass/04-elements/forms.scss @@ -20,6 +20,7 @@ input[type="color"], padding: var(--form--spacing-unit); // Gives a little more space for the outline offset. margin: 0 2px; + max-width: 100%; &:focus { color: var(--form--color-text); diff --git a/src/wp-content/themes/twentytwentyone/style-rtl.css b/src/wp-content/themes/twentytwentyone/style-rtl.css index 4b2fe9f993..049abb9c5f 100644 --- a/src/wp-content/themes/twentytwentyone/style-rtl.css +++ b/src/wp-content/themes/twentytwentyone/style-rtl.css @@ -1217,6 +1217,7 @@ input[type=color], line-height: var(--global--line-height-body); padding: var(--form--spacing-unit); margin: 0 2px; + max-width: 100%; } input[type=text]:focus, diff --git a/src/wp-content/themes/twentytwentyone/style.css b/src/wp-content/themes/twentytwentyone/style.css index ebf07438fc..a7c4267f1e 100644 --- a/src/wp-content/themes/twentytwentyone/style.css +++ b/src/wp-content/themes/twentytwentyone/style.css @@ -1225,6 +1225,7 @@ input[type=color], line-height: var(--global--line-height-body); padding: var(--form--spacing-unit); margin: 0 2px; + max-width: 100%; } input[type=text]:focus,