From 9a3b1b32f460cdac60d934aad59cf498bd515d6e Mon Sep 17 00:00:00 2001 From: Jonathan Neal Date: Thu, 17 Mar 2016 23:57:16 -0400 Subject: [PATCH 1/2] Reduce selector weight of input types --- normalize.css | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/normalize.css b/normalize.css index ae57050..cabe6a8 100644 --- a/normalize.css +++ b/normalize.css @@ -298,9 +298,9 @@ select { */ button, -html input[type="button"], /* 1 */ -input[type="reset"], -input[type="submit"] { +html [type="button"], /* 1 */ +[type="reset"], +[type="submit"] { -webkit-appearance: button; /* 2 */ cursor: pointer; /* 3 */ } @@ -309,8 +309,8 @@ input[type="submit"] { * Re-set default cursor for disabled elements. */ -button[disabled], -html input[disabled] { +[disabled], +html [disabled] { cursor: default; } @@ -341,8 +341,8 @@ input:-moz-focusring { * 2. Remove excess padding in IE 8/9/10. */ -input[type="checkbox"], -input[type="radio"] { +[type="checkbox"], +[type="radio"] { box-sizing: border-box; /* 1 */ padding: 0; /* 2 */ } @@ -353,8 +353,8 @@ input[type="radio"] { * decrement button to change from `default` to `text`. */ -input[type="number"]::-webkit-inner-spin-button, -input[type="number"]::-webkit-outer-spin-button { +[type="number"]::-webkit-inner-spin-button, +[type="number"]::-webkit-outer-spin-button { height: auto; } @@ -362,7 +362,7 @@ input[type="number"]::-webkit-outer-spin-button { * Address `appearance` set to `searchfield` in Safari and Chrome. */ -input[type="search"] { +[type="search"] { -webkit-appearance: textfield; } @@ -372,8 +372,8 @@ input[type="search"] { * padding (and `textfield` appearance). */ -input[type="search"]::-webkit-search-cancel-button, -input[type="search"]::-webkit-search-decoration { +[type="search"]::-webkit-search-cancel-button, +[type="search"]::-webkit-search-decoration { -webkit-appearance: none; } From 28f2f6c292a628abc95358d9b19fae90029ddcd5 Mon Sep 17 00:00:00 2001 From: Jonathan Neal Date: Thu, 17 Mar 2016 23:58:17 -0400 Subject: [PATCH 2/2] Move input type appearance normalization into its own rule --- normalize.css | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/normalize.css b/normalize.css index cabe6a8..d568396 100644 --- a/normalize.css +++ b/normalize.css @@ -293,8 +293,6 @@ select { * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio` * and `video` controls. * 2. Correct inability to style clickable `input` types in iOS. - * 3. Improve usability and consistency of cursor style between image-type - * `input` and others. */ button, @@ -302,15 +300,24 @@ html [type="button"], /* 1 */ [type="reset"], [type="submit"] { -webkit-appearance: button; /* 2 */ - cursor: pointer; /* 3 */ +} + +/** + * Improve consistency of cursor style between image-type `input` and others. + */ + +button, +[type="button"], +[type="reset"], +[type="submit"] { + cursor: pointer; } /** * Re-set default cursor for disabled elements. */ -[disabled], -html [disabled] { +[disabled] { cursor: default; }