From ec9f45390ac772a79de35ef8bc89c1b7ed08ec8a Mon Sep 17 00:00:00 2001 From: JohnAlbin Date: Fri, 21 Oct 2016 19:59:04 +0800 Subject: [PATCH] Convert old "html5" section into the new "sections" section. #88 --- fork-versions/default/_normalize.scss | 220 ++++++++++------- .../deprecated-compass/_normalize.scss | 228 +++++++++++------- .../typey-chroma-kss/base/_html5.scss | 55 ----- .../typey-chroma-kss/base/_normalize.scss | 6 +- .../base/embedded/_embedded.scss | 24 ++ .../typey-chroma-kss/base/forms/_forms.scss | 13 + .../typey-chroma-kss/base/hidden/_hidden.scss | 10 + .../base/interactive/_interactive.scss | 26 ++ .../base/scripting/_scripting.scss | 24 ++ .../_sections.scss} | 27 ++- .../{headings => sections}/headings-h.twig | 0 fork-versions/typey/_normalize.scss | 196 +++++++++------ sass/normalize/_normalize-mixin.scss | 211 +++++++++------- .../fixtures/fork-versions/default/output.css | 131 ++++++---- .../deprecated-compass/output.css | 135 +++++++---- .../fork-versions/typey-chroma-kss/output.css | 115 +++++---- test/fixtures/fork-versions/typey/output.css | 177 ++++++++------ test/fixtures/import-now/output.css | 118 +++++---- .../normalize/exclude-multiple/output.css | 104 ++++---- .../normalize/exclude-single/output.css | 108 +++++---- .../normalize/exclude-string/input.scss | 2 +- .../normalize/exclude-string/output.css | 104 ++++---- .../normalize/include-multiple/input.scss | 2 +- .../normalize/include-multiple/output.css | 47 +--- .../normalize/include-string/output.css | 9 - test/fixtures/variables/default/output.css | 118 +++++---- test/fixtures/variables/font/output.css | 164 +++++++------ .../variables/indent-amount/output.css | 164 +++++++------ 28 files changed, 1503 insertions(+), 1035 deletions(-) delete mode 100644 fork-versions/typey-chroma-kss/base/_html5.scss create mode 100644 fork-versions/typey-chroma-kss/base/hidden/_hidden.scss create mode 100644 fork-versions/typey-chroma-kss/base/interactive/_interactive.scss create mode 100644 fork-versions/typey-chroma-kss/base/scripting/_scripting.scss rename fork-versions/typey-chroma-kss/base/{headings/_headings.scss => sections/_sections.scss} (65%) rename fork-versions/typey-chroma-kss/base/{headings => sections}/headings-h.twig (100%) diff --git a/fork-versions/default/_normalize.scss b/fork-versions/default/_normalize.scss index c2dd31688..3e98e9e8b 100644 --- a/fork-versions/default/_normalize.scss +++ b/fork-versions/default/_normalize.scss @@ -44,7 +44,7 @@ html { -webkit-text-size-adjust: 100%; /* 3 */ } -/* HTML5 display definitions +/* Sections ========================================================================== */ /** @@ -56,62 +56,63 @@ body { } /** - * Add the correct display in IE <10. - * Add the correct display in Edge, IE, and Firefox for `details` or `summary`. - * Add the correct display in IE for `main`. + * Add the correct display in IE 9-. */ article, aside, -details, -figcaption, -figure, footer, header, -main, -menu, nav, -section, -summary { +section { display: block; } /** - * Add the correct display in IE <10. + * Correct the font size and margin on `h1` elements within `section` and + * `article` contexts in Chrome, Firefox, and Safari. */ -audio, -canvas, -progress, -video { - display: inline-block; -} - -/** - * Add the correct display and remove excess height in iOS 4-7. - */ +h1 { + @include normalize-font-size($h1-font-size); + @if $normalize-vertical-rhythm { + @include normalize-line-height($h1-font-size); + } -audio:not([controls]) { - display: none; - height: 0; + /* Set 1 unit of vertical rhythm on the top and bottom margins. */ + @include normalize-margin(1 0, $h1-font-size); } -/** - * Add the correct vertical alignment in Chrome, Firefox, and Opera. - */ +@if $normalize-vertical-rhythm { + h2 { + @include normalize-font-size($h2-font-size); + @include normalize-line-height($h2-font-size); + @include normalize-margin(1 0, $h2-font-size); + } -progress { - vertical-align: baseline; -} + h3 { + @include normalize-font-size($h3-font-size); + @include normalize-line-height($h3-font-size); + @include normalize-margin(1 0, $h3-font-size); + } -/** - * Add the correct display in IE <11, Safari <8, and Firefox <22. - * 1. Add the correct display in IE. - */ + h4 { + @include normalize-font-size($h4-font-size); + @include normalize-line-height($h4-font-size); + @include normalize-margin(1 0, $h4-font-size); + } -template, /* 1 */ -[hidden] { - display: none; + h5 { + @include normalize-font-size($h5-font-size); + @include normalize-line-height($h5-font-size); + @include normalize-margin(1 0, $h5-font-size); + } + + h6 { + @include normalize-font-size($h6-font-size); + @include normalize-line-height($h6-font-size); + @include normalize-margin(1 0, $h6-font-size); + } } /* Links @@ -190,53 +191,6 @@ dfn { font-style: italic; } -/** - * Correct the font size and margin on `h1` elements within `section` and - * `article` contexts in Chrome, Firefox, and Safari. - */ - -h1 { - @include normalize-font-size($h1-font-size); - @if $normalize-vertical-rhythm { - @include normalize-line-height($h1-font-size); - } - - /* Set 1 unit of vertical rhythm on the top and bottom margins. */ - @include normalize-margin(1 0, $h1-font-size); -} - -@if $normalize-vertical-rhythm { - h2 { - @include normalize-font-size($h2-font-size); - @include normalize-line-height($h2-font-size); - @include normalize-margin(1 0, $h2-font-size); - } - - h3 { - @include normalize-font-size($h3-font-size); - @include normalize-line-height($h3-font-size); - @include normalize-margin(1 0, $h3-font-size); - } - - h4 { - @include normalize-font-size($h4-font-size); - @include normalize-line-height($h4-font-size); - @include normalize-margin(1 0, $h4-font-size); - } - - h5 { - @include normalize-font-size($h5-font-size); - @include normalize-line-height($h5-font-size); - @include normalize-margin(1 0, $h5-font-size); - } - - h6 { - @include normalize-font-size($h6-font-size); - @include normalize-line-height($h6-font-size); - @include normalize-margin(1 0, $h6-font-size); - } -} - /** * Add the correct background and color in IE <10. */ @@ -278,6 +232,24 @@ sup { /* Embedded content ========================================================================== */ +/** + * Add the correct display in IE 9-. + */ + +audio, +video { + display: inline-block; +} + +/** + * Add the correct display in iOS 4-7. + */ + +audio:not([controls]) { + display: none; + height: 0; +} + /** * Remove the border on images inside links in IE <11. */ @@ -336,6 +308,15 @@ svg:not(:root) { } } +/** + * Add the correct display in IE 9-. + */ + +figcaption, +figure { + display: block; +} + /** * Add the correct margin in IE 8. */ @@ -355,6 +336,14 @@ hr { overflow: visible; /* 2 */ } +/** + * Add the correct display in IE. + */ + +main { + display: block; +} + @if $normalize-vertical-rhythm { /** * Set 1 unit of vertical rhythm on the top and bottom margin. @@ -561,6 +550,16 @@ optgroup { font-weight: bold; } +/** + * 1. Add the correct display in IE 9-. + * 2. Add the correct vertical alignment in Chrome, Firefox, and Opera. + */ + +progress { + display: inline-block; /* 1 */ + vertical-align: baseline; /* 2 */ +} + /** * Remove the default vertical scrollbar in IE. */ @@ -568,3 +567,54 @@ optgroup { textarea { overflow: auto; } + +/* Interactive + ========================================================================== */ + +/* + * Add the correct display in IE 9-. + * 1. Add the correct display in Edge, IE, and Firefox. + */ + +details, /* 1 */ +menu { + display: block; +} + +/* + * Add the correct display in all browsers. + */ + +summary { + display: list-item; +} + +/* Scripting + ========================================================================== */ + +/** + * Add the correct display in IE 9-. + */ + +canvas { + display: inline-block; +} + +/** + * Add the correct display in IE. + */ + +template { + display: none; +} + +/* Hidden + ========================================================================== */ + +/** + * Add the correct display in IE 10-. + */ + +[hidden] { + display: none; +} diff --git a/fork-versions/deprecated-compass/_normalize.scss b/fork-versions/deprecated-compass/_normalize.scss index 3dbfe88b2..7f89ddaf5 100644 --- a/fork-versions/deprecated-compass/_normalize.scss +++ b/fork-versions/deprecated-compass/_normalize.scss @@ -47,7 +47,7 @@ html { -webkit-text-size-adjust: 100%; /* 2 */ } -/* HTML5 display definitions +/* Sections ========================================================================== */ /** @@ -59,62 +59,67 @@ body { } /** - * Add the correct display in IE <10. - * Add the correct display in Edge, IE, and Firefox for `details` or `summary`. - * Add the correct display in IE for `main`. + * Add the correct display in IE 9-. */ article, aside, -details, -figcaption, -figure, footer, header, -main, -menu, nav, -section, -summary { +section { display: block; } /** - * Add the correct display in IE <10. + * Correct the font size and margin on `h1` elements within `section` and + * `article` contexts in Chrome, Firefox, and Safari. */ -audio, -canvas, -progress, -video { - display: inline-block; -} - -/** - * Add the correct display and remove excess height in iOS 4-7. - */ +h1 { + /* Set the font-size and line-height while keeping a proper vertical rhythm. */ + @if $normalize-vertical-rhythm { + @include adjust-font-size-to( $h1-font-size ); + } + @else { + font-size: if($rhythm-unit == "px", $h1-font-size, unquote("#{$h1-font-size / $base-font-size}#{$rhythm-unit}")); + } -audio:not([controls]) { - display: none; - height: 0; + /* Set 1 unit of vertical rhythm on the top and bottom margins. */ + @include leader(1, $h1-font-size); + @include trailer(1, $h1-font-size); } -/** - * Add the correct vertical alignment in Chrome, Firefox, and Opera. - */ +@if $normalize-vertical-rhythm { + h2 { + @include adjust-font-size-to( $h2-font-size ); + @include leader(1, $h2-font-size); + @include trailer(1, $h2-font-size); + } -progress { - vertical-align: baseline; -} + h3 { + @include adjust-font-size-to( $h3-font-size ); + @include leader(1, $h3-font-size); + @include trailer(1, $h3-font-size); + } -/** - * Add the correct display in IE <11, Safari <8, and Firefox <22. - * 1. Add the correct display in IE. - */ + h4 { + @include adjust-font-size-to( $h4-font-size ); + @include leader(1, $h4-font-size); + @include trailer(1, $h4-font-size); + } -template, /* 1 */ -[hidden] { - display: none; + h5 { + @include adjust-font-size-to( $h5-font-size ); + @include leader(1, $h5-font-size); + @include trailer(1, $h5-font-size); + } + + h6 { + @include adjust-font-size-to( $h6-font-size ); + @include leader(1, $h6-font-size); + @include trailer(1, $h6-font-size); + } } /* Links @@ -193,57 +198,6 @@ dfn { font-style: italic; } -/** - * Correct the font size and margin on `h1` elements within `section` and - * `article` contexts in Chrome, Firefox, and Safari. - */ - -h1 { - /* Set the font-size and line-height while keeping a proper vertical rhythm. */ - @if $normalize-vertical-rhythm { - @include adjust-font-size-to( $h1-font-size ); - } - @else { - font-size: if($rhythm-unit == "px", $h1-font-size, unquote("#{$h1-font-size / $base-font-size}#{$rhythm-unit}")); - } - - /* Set 1 unit of vertical rhythm on the top and bottom margins. */ - @include leader(1, $h1-font-size); - @include trailer(1, $h1-font-size); -} - -@if $normalize-vertical-rhythm { - h2 { - @include adjust-font-size-to( $h2-font-size ); - @include leader(1, $h2-font-size); - @include trailer(1, $h2-font-size); - } - - h3 { - @include adjust-font-size-to( $h3-font-size ); - @include leader(1, $h3-font-size); - @include trailer(1, $h3-font-size); - } - - h4 { - @include adjust-font-size-to( $h4-font-size ); - @include leader(1, $h4-font-size); - @include trailer(1, $h4-font-size); - } - - h5 { - @include adjust-font-size-to( $h5-font-size ); - @include leader(1, $h5-font-size); - @include trailer(1, $h5-font-size); - } - - h6 { - @include adjust-font-size-to( $h6-font-size ); - @include leader(1, $h6-font-size); - @include trailer(1, $h6-font-size); - } -} - /** * Add the correct background and color in IE <10. */ @@ -285,6 +239,24 @@ sup { /* Embedded content ========================================================================== */ +/** + * Add the correct display in IE 9-. + */ + +audio, +video { + display: inline-block; +} + +/** + * Add the correct display in iOS 4-7. + */ + +audio:not([controls]) { + display: none; + height: 0; +} + /** * Remove the border on images inside links in IE <11. */ @@ -343,6 +315,15 @@ svg:not(:root) { } } +/** + * Add the correct display in IE 9-. + */ + +figcaption, +figure { + display: block; +} + /** * Add the correct margin in IE 8. */ @@ -362,6 +343,14 @@ hr { overflow: visible; /* 2 */ } +/** + * Add the correct display in IE. + */ + +main { + display: block; +} + @if $normalize-vertical-rhythm { /** * Set 1 unit of vertical rhythm on the top and bottom margin. @@ -572,6 +561,16 @@ optgroup { font-weight: bold; } +/** + * 1. Add the correct display in IE 9-. + * 2. Add the correct vertical alignment in Chrome, Firefox, and Opera. + */ + +progress { + display: inline-block; /* 1 */ + vertical-align: baseline; /* 2 */ +} + /** * Remove the default vertical scrollbar in IE. */ @@ -579,3 +578,54 @@ optgroup { textarea { overflow: auto; } + +/* Interactive + ========================================================================== */ + +/* + * Add the correct display in IE 9-. + * 1. Add the correct display in Edge, IE, and Firefox. + */ + +details, /* 1 */ +menu { + display: block; +} + +/* + * Add the correct display in all browsers. + */ + +summary { + display: list-item; +} + +/* Scripting + ========================================================================== */ + +/** + * Add the correct display in IE 9-. + */ + +canvas { + display: inline-block; +} + +/** + * Add the correct display in IE. + */ + +template { + display: none; +} + +/* Hidden + ========================================================================== */ + +/** + * Add the correct display in IE 10-. + */ + +[hidden] { + display: none; +} diff --git a/fork-versions/typey-chroma-kss/base/_html5.scss b/fork-versions/typey-chroma-kss/base/_html5.scss deleted file mode 100644 index e4cecf91c..000000000 --- a/fork-versions/typey-chroma-kss/base/_html5.scss +++ /dev/null @@ -1,55 +0,0 @@ -// HTML5 display definitions -// ========================================================================== - - -body { - // Output a horizontal grid to help with debugging typography. The - // $typey-debug variable will toggle its output. - @include typey-debug-grid(); - // Remove default margin and padding. - margin: 0; - padding: 0; -} - -// Add the correct display in IE <10. -// Add the correct display in Edge, IE, and Firefox for `details` or `summary`. -// Add the correct display in IE for `main`. -article, -aside, -details, -figcaption, -figure, -footer, -header, -main, -menu, -nav, -section, -summary { - display: block; -} - -// Add the correct display in IE <10. -audio, -canvas, -progress, -video { - display: inline-block; -} - -// Add the correct display and remove excess height in iOS 4-7. -audio:not([controls]) { - display: none; - height: 0; -} - -// Add the correct vertical alignment in Chrome, Firefox, and Opera. -progress { - vertical-align: baseline; -} - -// Add the correct display in IE <11, Safari <8, and Firefox <22. -template, -[hidden] { - display: none; -} diff --git a/fork-versions/typey-chroma-kss/base/_normalize.scss b/fork-versions/typey-chroma-kss/base/_normalize.scss index 1803466c0..1d4a83f6c 100644 --- a/fork-versions/typey-chroma-kss/base/_normalize.scss +++ b/fork-versions/typey-chroma-kss/base/_normalize.scss @@ -10,14 +10,16 @@ // Normalize-scss is broken into modular pieces to make it easier to edit. @import 'document/document'; -@import 'html5'; +@import 'sections/sections'; @import 'links/links'; -@import 'headings/headings'; @import 'text/text'; @import 'grouping/grouping'; @import 'embedded/embedded'; @import 'forms/forms'; @import 'tables/tables'; +@import 'interactive/interactive'; +@import 'scripting/scripting'; +@import 'hidden/hidden'; // Note: we allow the .button component (loaded by forms) to override :link, by // loading links first. diff --git a/fork-versions/typey-chroma-kss/base/embedded/_embedded.scss b/fork-versions/typey-chroma-kss/base/embedded/_embedded.scss index 23359d0c1..f98c3bf82 100644 --- a/fork-versions/typey-chroma-kss/base/embedded/_embedded.scss +++ b/fork-versions/typey-chroma-kss/base/embedded/_embedded.scss @@ -4,6 +4,21 @@ // // Style guide: base.embedded +// Audio +// +// Style guide: base.embedded.audio + +audio { + // Add the correct display in IE 9-. + display: inline-block; +} + +// Add the correct display and remove excess height in iOS 4-7. +audio:not([controls]) { + display: none; + height: 0; +} + // Image // // An `` element represents an image. @@ -39,3 +54,12 @@ svg:not(:root) { // Hide the overflow in IE. overflow: hidden; } + +// Video +// +// Style guide: base.embedded.video + +video { + // Add the correct display in IE 9-. + display: inline-block; +} diff --git a/fork-versions/typey-chroma-kss/base/forms/_forms.scss b/fork-versions/typey-chroma-kss/base/forms/_forms.scss index c59c0ff7b..4d0285cb7 100644 --- a/fork-versions/typey-chroma-kss/base/forms/_forms.scss +++ b/fork-versions/typey-chroma-kss/base/forms/_forms.scss @@ -234,6 +234,19 @@ optgroup { font-weight: bold; } +// Progress +// +// The `` HTML element. +// +// Style guide: forms.base.progress + +progress { + // Add the correct display in IE 9-. + display: inline-block; + // Add the correct vertical alignment in Chrome, Firefox, and Opera. + vertical-align: baseline; +} + // Text areas // // The `