Commit 30d3999b authored by JeffreyCA's avatar JeffreyCA Committed by Commit Bot

Use opacity of 0.54 for placeholder text in input fields

Prior to this change, placeholder text in input fields was set to grey
(#757575), but this did not apply to emojis. Now, we use an opacity
value to control the placeholder appearance. 0.54 is used because in a
white input field, regular placeholder text still appears as #757575.

Bug: 932026
Change-Id: Iba02fe3eb31484255332f2f34a67f97b97f50cb8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1754086
Commit-Queue: Jeffrey C <jeffreyca16@gmail.com>
Reviewed-by: default avatarEmil A Eklund <eae@chromium.org>
Reviewed-by: default avatarAlice Boxhall <aboxhall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#691770}
parent 1f62c926
......@@ -511,7 +511,7 @@ textarea {
::-webkit-input-placeholder {
-webkit-text-security: none;
color: #757575;
color: rgba(0, 0, 0, 0.54);
pointer-events: none !important;
}
......
......@@ -2,7 +2,7 @@
<head>
<style>
#pass1, #pass3 {
color: #757575;
color: rgba(0, 0, 0, 0.54);
}
</style>
</head>
......
<style>
input { color: #757575; font-size: 30px; width: 500px; }
input { color: rgba(0, 0, 0, 0.54); font-size: 30px; width: 500px; }
input.a { text-indent: 0px; }
input.b { text-indent: 10px; }
input.c { text-indent: 200px; }
......
<!DOCTYPE html>
<style>
input {
color: rgba(0, 0, 0, 0.54);
line-height: 15px;
}
</style>
This tests that emojis in placeholders appear faded along with the text.
<div>
<input value="default 😊">
<input disabled value="default disabled 😊">
</div>
<!DOCTYPE html>
<style>
input {
line-height: 15px;
}
</style>
This tests that emojis in placeholders appear faded along with the text.
<div>
<input placeholder="default 😊">
<input disabled placeholder="default disabled 😊">
</div>
<!DOCTYPE html>
<style>
input {
color: #757575;
color: rgba(0, 0, 0, 0.54);
}
input.red {
......@@ -31,7 +31,7 @@ This tests that you can set the placeholder text color.
<div>
Default style:
<input value="default">
<input value="default disabled">
<input disabled value="default disabled">
</div>
<div>
......
......@@ -27,7 +27,7 @@ This tests that you can set the placeholder text color.
<div>
Default style:
<input placeholder="default">
<input placeholder="default disabled">
<input disabled placeholder="default disabled">
</div>
<div>
......
......@@ -2,4 +2,4 @@
<div>aaa</div>
<div>bbb</div>
</div>
<input style="color: #757575;" value="placeholder">
<input style="color: rgba(0, 0, 0, 0.54);" value="placeholder">
<!DOCTYPE html>
<style>
textarea {
color: #757575;
color: rgba(0, 0, 0, 0.54);
}
.red {
......
<textarea rows=8>
A quick brown fox jumps over the lazy dog. A quick brown fox jumps over the lazy dog.
</textarea>
<textarea rows=8 style="color: #757575;">
<textarea rows=8 style="color: rgba(0, 0, 0, 0.54);">
A quick brown fox jumps over the lazy dog. A quick brown fox jumps over the lazy dog.
</textarea>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment