Skip to content

Commit 2691e7a

Browse files
committed
Addresses placeholder text remaining visible on focus in Chrome
The placeholder attribute in Chrome does not work to spec. This makes the text transparent on focus to work like Firefox, Safari, and the spec. Credit goes to @chadbaudoin for bringing this up in his pull request necolas#86 and this Chrome bug is further documented at http://code.google.com/p/chromium/issues/detail?id=106714 and my own test is at https://tinker.io/be2f2/1
1 parent 79e2c16 commit 2691e7a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

normalize.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,14 @@ input[type="search"]::-webkit-search-cancel-button {
476476
color: #a9a9a9;
477477
}
478478

479+
/*
480+
* Addresses placeholder text remaining visible on focus in Chrome
481+
*/
482+
483+
:focus::-webkit-input-placeholder {
484+
color: transparent;
485+
}
486+
479487
/*
480488
* Removes inner padding and border in FF3+
481489
* www.sitepen.com/blog/2008/05/14/the-devils-in-the-details-fixing-dojos-toolbar-buttons/

0 commit comments

Comments
 (0)