From a31d02b49ea10fe0ac31632f2f67dd408f970e9f Mon Sep 17 00:00:00 2001 From: xuhong Date: Fri, 10 Jun 2016 12:42:02 +0800 Subject: [PATCH] Update to the lastest normalize.css --- lib/nib/normalize/embed.styl | 2 +- lib/nib/normalize/forms.styl | 85 +++++++++++++++++++++-------------- lib/nib/normalize/groups.styl | 5 +-- lib/nib/normalize/html5.styl | 19 ++++++-- lib/nib/normalize/index.styl | 2 - lib/nib/normalize/links.styl | 3 +- lib/nib/normalize/tables.styl | 7 --- lib/nib/normalize/text.styl | 14 ++++-- 8 files changed, 80 insertions(+), 57 deletions(-) delete mode 100644 lib/nib/normalize/tables.styl diff --git a/lib/nib/normalize/embed.styl b/lib/nib/normalize/embed.styl index ab956cb3..c27785fd 100644 --- a/lib/nib/normalize/embed.styl +++ b/lib/nib/normalize/embed.styl @@ -1,7 +1,7 @@ // Based in Nicolas Gallagher's git.io/normalize normalize-embed() img // No border when inside `a` in IE 8~10. - border 0 + border-style none svg:not(:root) // Overflow should be hidden in IE 9~11. overflow hidden diff --git a/lib/nib/normalize/forms.styl b/lib/nib/normalize/forms.styl index 7c080e66..a5e262a0 100644 --- a/lib/nib/normalize/forms.styl +++ b/lib/nib/normalize/forms.styl @@ -3,11 +3,13 @@ normalize-forms() // Known limitation: Chrome and Safari on OS X allow very limited // styling of `select`, unless a `border` property is set. button, input, optgroup, select, textarea - color inherit // Correct color not being inherited. font inherit // Correct font properties not being inherited. margin 0 // Fix margins in FF 4+, Safari, and Chrome. - - button // Fix `overflow` set to `hidden` in IE 8/9/10/11. + + optgroup // Don't inherit the `font-weight` applied above. + font-weight bold + + button, input // Fix `overflow` set to `hidden` in IE 8/9/10/11. overflow visible button, select // Consistent text-transform across browsers. @@ -15,55 +17,70 @@ normalize-forms() // Fix WebKit bug in Android 4.0, inability to style clickable `input` in // iOS and improve usability and consistency of cursor style. - button, html input[type='button'], input[type='reset'], input[type='submit'] - cursor pointer + button, + html [type='button'], + [type='reset'], + [type='submit'] -webkit-appearance button - // Reset default cursor for disabled elements. - button[disabled], html input[disabled] - cursor default + // Remove inner padding and border in FF 4+.button::-moz-focus-inner, + button::-moz-focus-inner, + [type="button"]::-moz-focus-inner, + [type="reset"]::-moz-focus-inner, + [type="submit"]::-moz-focus-inner + border-style none + padding 0 + + button:-moz-focusring, + [type="button"]:-moz-focusring, + [type="reset"]:-moz-focusring, + [type="submit"]:-moz-focusring + outline 1px dotted ButtonText + + fieldset // Consistent border, margin, and padding. + border 1px solid #c0c0c0 + margin 0 2px + padding 0.35em 0.625em 0.75em - // Remove inner padding and border in FF 4+. - button::-moz-focus-inner, input::-moz-focus-inner - border 0 + legend // Hack to correct `color` not being inherited in IE 8/9/10/11. + box-sizing border-box + color inherit + display table + max-width 100% padding 0 + white-space normal + textarea // Remove default vertical scrollbar in IE 8~11. + overflow auto + input // Reset line-height again FF 4+ UA stylsheet. line-height normal // Fix box sizing and excess padding in IE 8~10 - input[type='checkbox'], input[type='radio'] + [type='checkbox'], [type='radio'] box-sizing border-box padding 0 // Fix the cursor style for Chrome's increment/decrement buttons. - 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 // Consistent appearance and box-sizing in Safari and Chrome. input[type='search'] -webkit-appearance textfield - -moz-box-sizing content-box - -webkit-box-sizing content-box - box-sizing content-box - + outline-offset -2px + // No inner padding and search cancel button in Safari and Chrome on OS X. - 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 + + // Correct the text style of placeholders in Chrome, Edge, and Safari. + ::-webkit-input-placeholder + color inherit + opacity 0.54 - fieldset // Consistent border, margin, and padding. - border 1px solid #c0c0c0 - margin 0 2px - padding 0.35em 0.625em 0.75em - - legend // Hack to correct `color` not being inherited in IE 8/9/10/11. - border 0 - padding 0 - - textarea // Remove default vertical scrollbar in IE 8~11. - overflow auto - - optgroup // Don't inherit the `font-weight` applied above. - font-weight bold + ::-webkit-file-upload-button + -webkit-appearance button + font inerit diff --git a/lib/nib/normalize/groups.styl b/lib/nib/normalize/groups.styl index d9c0996d..97991a14 100644 --- a/lib/nib/normalize/groups.styl +++ b/lib/nib/normalize/groups.styl @@ -4,12 +4,9 @@ normalize-groups() margin 1em 40px hr // Consistency between FF and others. - -moz-box-sizing content-box box-sizing content-box height 0 - - pre // Contain overflow and wrap words. - overflow auto + overflow visible // Hack to fix odd `em`-unit font size rendering in all browsers. code, kbd, pre, samp diff --git a/lib/nib/normalize/html5.styl b/lib/nib/normalize/html5.styl index 729c3b95..72494533 100644 --- a/lib/nib/normalize/html5.styl +++ b/lib/nib/normalize/html5.styl @@ -1,18 +1,29 @@ // Based in Nicolas Gallagher's git.io/normalize normalize-html5() // `block` display for HTML5 elements in IE 8~11 and FF. - article, details, section, summary, - aside, main, menu, nav, figcaption, - figure, footer, header, hgroup + article, + aside, + details, /* 1 */ + figcaption, + figure, + footer, + header, + main, /* 2 */ + menu, + nav, + section, + summary display block audio, canvas, progress, video display inline-block // Set `inline-block` not defined in IE 8~9. - vertical-align baseline // Fix v-align of `progress` in Chrome, FF, and O. audio:not([controls]) display none // Prevent displaying `audio` without controls. height 0 // Remove excess height in iOS 5 devices. + + progress + vertical-align baseline [hidden], // Address `[hidden]` styling not present in IE 8~10. template // Hide the `template` element in IE 8~11, Safari, and FF < 22. diff --git a/lib/nib/normalize/index.styl b/lib/nib/normalize/index.styl index 1896bfb7..b00b16cf 100644 --- a/lib/nib/normalize/index.styl +++ b/lib/nib/normalize/index.styl @@ -6,7 +6,6 @@ @import './embed' @import './groups' @import './forms' -@import './tables' normalize-css() normalize-base() @@ -16,4 +15,3 @@ normalize-css() normalize-embed() normalize-groups() normalize-forms() - normalize-tables() diff --git a/lib/nib/normalize/links.styl b/lib/nib/normalize/links.styl index 28c10329..fb3a3253 100644 --- a/lib/nib/normalize/links.styl +++ b/lib/nib/normalize/links.styl @@ -2,5 +2,6 @@ normalize-links() a // No gray bg color in active links in IE 10. background-color transparent + -webkit-text-decoration-skip objects &:active, &:hover - outline 0 // + readability when focused. + outline-width 0 // + readability when focused. diff --git a/lib/nib/normalize/tables.styl b/lib/nib/normalize/tables.styl deleted file mode 100644 index da7c4784..00000000 --- a/lib/nib/normalize/tables.styl +++ /dev/null @@ -1,7 +0,0 @@ -// Based in Nicolas Gallagher's git.io/normalize -normalize-tables() - table // Remove most spacing between table cells. - border-collapse collapse - border-spacing 0 - td, th - padding 0 diff --git a/lib/nib/normalize/text.styl b/lib/nib/normalize/text.styl index e4328ccc..c70bb1a0 100644 --- a/lib/nib/normalize/text.styl +++ b/lib/nib/normalize/text.styl @@ -1,16 +1,22 @@ // Based in Nicolas Gallagher's git.io/normalize normalize-text() abbr[title] // + style not present in IE 8~11, Safari, and Chrome. - border-bottom 1px dotted + border-bottom none + text-decoration underline + text-decoration underline dotted dfn // + style not present in Safari and Chrome. font-style italic mark // + style not present in IE 8/9. - background #ff0; color #000 - + background #ff0 + color #000 + + b, strong // Prevent the duplicate application of `bolder` by the next rule in Safari 6. + font-weight inherit + b, strong // Fix `font-weight: bolder` in FF 4+, Safari, and Chrome. - font-weight bold + font-weight bolder h1 // `h1` inside `section` and `article` fix for FF 4+, Safari & Chrome. font-size 2em