From 2691e7ab14682dc8f9e942456887df0e35804087 Mon Sep 17 00:00:00 2001 From: Jonathan Neal Date: Fri, 9 Mar 2012 13:30:17 -0800 Subject: [PATCH] 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 https://github.com/necolas/normalize.css/pull/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 --- normalize.css | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/normalize.css b/normalize.css index 4a460a3..0ecc517 100644 --- a/normalize.css +++ b/normalize.css @@ -476,6 +476,14 @@ input[type="search"]::-webkit-search-cancel-button { color: #a9a9a9; } +/* + * Addresses placeholder text remaining visible on focus in Chrome + */ + +:focus::-webkit-input-placeholder { + color: transparent; +} + /* * Removes inner padding and border in FF3+ * www.sitepen.com/blog/2008/05/14/the-devils-in-the-details-fixing-dojos-toolbar-buttons/