From 1314aad37c8e137018a7de71385de314e549be3c Mon Sep 17 00:00:00 2001 From: Jina Bolton Date: Sun, 27 Jul 2014 14:44:36 -0700 Subject: [PATCH] Separate out HTML5 Boilerplate styles and reformat CSS a little. --- source/assets/css/_print.scss | 57 ------- source/assets/css/foundation/_forms.scss | 5 +- source/assets/css/foundation/_media.scss | 8 +- source/assets/css/foundation/_site.scss | 8 +- source/assets/css/sass.css.scss | 141 +++++++++++------- .../css/vendor/html5boilerplate/_base.scss | 77 ++++++++++ .../vendor/html5boilerplate/_browsehappy.scss | 10 ++ .../css/vendor/html5boilerplate/_helpers.scss | 72 +++++++++ .../css/vendor/html5boilerplate/_print.scss | 67 +++++++++ .../vendor/html5boilerplate/_responsive.scss | 16 ++ 10 files changed, 337 insertions(+), 124 deletions(-) delete mode 100644 source/assets/css/_print.scss create mode 100644 source/assets/css/vendor/html5boilerplate/_base.scss create mode 100644 source/assets/css/vendor/html5boilerplate/_browsehappy.scss create mode 100644 source/assets/css/vendor/html5boilerplate/_helpers.scss create mode 100644 source/assets/css/vendor/html5boilerplate/_print.scss create mode 100644 source/assets/css/vendor/html5boilerplate/_responsive.scss diff --git a/source/assets/css/_print.scss b/source/assets/css/_print.scss deleted file mode 100644 index db261fd..0000000 --- a/source/assets/css/_print.scss +++ /dev/null @@ -1,57 +0,0 @@ -@media print { - * { - background: transparent !important; - box-shadow: none !important; - color: black !important; - text-shadow: none !important; - } - - a { - &, - &:visited { - text-decoration: underline; - } - - &[href]:after { - content: " (" attr(href) ")"; - } - - .ir &, - &[href^="javascript:"], - &[href^="#"] { - &:after { - content: ""; - } - } - } - - pre { - border: 1px solid #999999; - page-break-inside: avoid; - } - - tr, - img { - page-break-inside: avoid; - } - - img { - max-width: 100% !important; - } - - @page { - margin: 0.5cm; - } - - p, - h2, - h3 { - orphans: 3; - widows: 3; - } - - h2, - h3 { - page-break-after: avoid; - } -} diff --git a/source/assets/css/foundation/_forms.scss b/source/assets/css/foundation/_forms.scss index ce61c46..7986ad8 100644 --- a/source/assets/css/foundation/_forms.scss +++ b/source/assets/css/foundation/_forms.scss @@ -1,11 +1,8 @@ -form, -fieldset { +form { @extend %reset-margin; @extend %reset-padding; } -fieldset { @extend %reset-border; } - label { @extend %bold-elements; @include padding-leader; diff --git a/source/assets/css/foundation/_media.scss b/source/assets/css/foundation/_media.scss index 1e0037b..36450f2 100644 --- a/source/assets/css/foundation/_media.scss +++ b/source/assets/css/foundation/_media.scss @@ -2,19 +2,13 @@ img { display: inline-block; max-width: 100%; height: auto; - vertical-align: middle; } hr { $new-spacing: ($base-line-height - 1) / $base-line-height; @include leader($new-spacing); @include trailer($new-spacing); - display: block; - padding: 0; - height: 1px; - border: 0 { - top: 1px solid $color-border; - } + border-top-color: $color-border; } figure { diff --git a/source/assets/css/foundation/_site.scss b/source/assets/css/foundation/_site.scss index 1ff7c7d..8d51a72 100644 --- a/source/assets/css/foundation/_site.scss +++ b/source/assets/css/foundation/_site.scss @@ -27,14 +27,10 @@ html { body { background: none; } -@mixin theme-selection { - background: $color-background-shade; - text-shadow: none; -} +@mixin theme-selection { background: $color-background-shade; } -// These have to be separate. ::-moz-selection { @include theme-selection; } -::selection { @include theme-selection; } +::selection { @include theme-selection; } diff --git a/source/assets/css/sass.css.scss b/source/assets/css/sass.css.scss index c7fb8c3..c26d48b 100755 --- a/source/assets/css/sass.css.scss +++ b/source/assets/css/sass.css.scss @@ -2,75 +2,116 @@ * by Team Sass Design (@teamsassdesign) */ -@import "compass"; -@import "compass/layout"; -@import "susy"; -@import "breakpoint"; -@import "normalize-rails"; + + +// --------------------------------------------------------------------------- +// VENDOR LIBRARIES + +@import + "compass" +, "compass/layout" +, "susy" +, "breakpoint" +; -@import "dependencies/layout"; -@import "dependencies/typography"; -@import "dependencies/color"; -@import "dependencies/animations"; +// --------------------------------------------------------------------------- +// DEPENDENCIES + +@import + "dependencies/layout" +, "dependencies/typography" +, "dependencies/color" +, "dependencies/animations" +; -@import "foundation/site"; -@import "foundation/block"; -@import "foundation/inline"; -@import "foundation/headings"; -@import "foundation/lists"; -@import "foundation/tables"; -@import "foundation/forms"; -@import "foundation/code"; -@import "foundation/media"; +// --------------------------------------------------------------------------- +// FOUNDATION + +@import + "normalize-rails" +, "vendor/html5boilerplate/base" +, "foundation/site" +, "foundation/block" +, "foundation/inline" +, "foundation/headings" +, "foundation/lists" +, "foundation/tables" +, "foundation/forms" +, "foundation/code" +, "foundation/media" +; -@import "vendor/jquery-ui-1.10.4.custom"; -@import "components/pop-stripe"; -@import "components/type"; -@import "components/page-header"; -@import "components/lists"; -@import "components/tables"; -@import "components/forms"; -@import "components/buttons"; -@import "components/code"; -@import "components/alerts"; -@import "components/progress"; -@import "components/articles"; -@import "components/hero-image"; -@import "components/header-image"; -@import "components/get-started"; -@import "components/slides"; -@import "components/icons"; -@import "components/logos"; -@import "components/sass-syntax-switcher"; +// --------------------------------------------------------------------------- +// COMPONENTS + +@import + "vendor/html5boilerplate/browsehappy" +, "vendor/jquery-ui-1.10.4.custom" +, "components/pop-stripe" +, "components/type" +, "components/page-header" +, "components/lists" +, "components/tables" +, "components/forms" +, "components/buttons" +, "components/code" +, "components/alerts" +, "components/progress" +, "components/articles" +, "components/hero-image" +, "components/header-image" +, "components/get-started" +, "components/slides" +, "components/icons" +, "components/logos" +, "components/sass-syntax-switcher" +; -@import "regions/page"; -@import "regions/banner"; -@import "regions/navigation"; -@import "regions/content"; -@import "regions/content-primary"; -@import "regions/content-secondary"; -@import "regions/main"; -@import "regions/complementary"; -@import "regions/section-bottom"; -@import "regions/contentinfo"; +// --------------------------------------------------------------------------- +// REGIONS + +@import + "regions/page" +, "regions/banner" +, "regions/navigation" +, "regions/content" +, "regions/content-primary" +, "regions/content-secondary" +, "regions/main" +, "regions/complementary" +, "regions/section-bottom" +, "regions/contentinfo" +; -@import "helpers/grid"; -@import "helpers/helpers"; +// --------------------------------------------------------------------------- +// HELPERS + +@import + "vendor/html5boilerplate/helpers" +, "helpers/grid" +, "helpers/helpers" +; +// --------------------------------------------------------------------------- +// PAGES + @import "styleguide/guide"; -@import "print"; +// --------------------------------------------------------------------------- +// RESPONSIVE + +@import "vendor/html5boilerplate/print"; diff --git a/source/assets/css/vendor/html5boilerplate/_base.scss b/source/assets/css/vendor/html5boilerplate/_base.scss new file mode 100644 index 0000000..57e1c8c --- /dev/null +++ b/source/assets/css/vendor/html5boilerplate/_base.scss @@ -0,0 +1,77 @@ +/*! HTML5 Boilerplate v4.3.0 | MIT License | http://h5bp.com/ */ + +/* + * What follows is the result of much research on cross-browser styling. + * Credit left inline and big thanks to Nicolas Gallagher, Jonathan Neal, + * Kroc Camen, and the H5BP dev community and team. + */ + +/* ========================================================================== + Base styles: opinionated defaults + ========================================================================== */ + +html { + color: #222; + font-size: 1em; + line-height: 1.4; +} + +/* + * Remove text-shadow in selection highlight: h5bp.com/i + * These selection rule sets have to be separate. + * Customize the background color to match your design. + */ + +::-moz-selection { + background: #b3d4fc; + text-shadow: none; +} + +::selection { + background: #b3d4fc; + text-shadow: none; +} + +/* + * A better looking default horizontal rule + */ + +hr { + display: block; + height: 1px; + border: 0; + border-top: 1px solid #ccc; + margin: 1em 0; + padding: 0; +} + +/* + * Remove the gap between images, videos, audio and canvas and the bottom of + * their containers: h5bp.com/i/440 + */ + +audio, +canvas, +img, +svg, +video { + vertical-align: middle; +} + +/* + * Remove default fieldset styles. + */ + +fieldset { + border: 0; + margin: 0; + padding: 0; +} + +/* + * Allow only vertical resizing of textareas. + */ + +textarea { + resize: vertical; +} diff --git a/source/assets/css/vendor/html5boilerplate/_browsehappy.scss b/source/assets/css/vendor/html5boilerplate/_browsehappy.scss new file mode 100644 index 0000000..a26abfa --- /dev/null +++ b/source/assets/css/vendor/html5boilerplate/_browsehappy.scss @@ -0,0 +1,10 @@ +/* ========================================================================== + Browse Happy prompt + ========================================================================== */ + +.browsehappy { + margin: 0.2em 0; + background: #ccc; + color: #000; + padding: 0.2em 0; +} diff --git a/source/assets/css/vendor/html5boilerplate/_helpers.scss b/source/assets/css/vendor/html5boilerplate/_helpers.scss new file mode 100644 index 0000000..8c7d670 --- /dev/null +++ b/source/assets/css/vendor/html5boilerplate/_helpers.scss @@ -0,0 +1,72 @@ +/* ========================================================================== + Helper classes + ========================================================================== */ + +/* + * Hide visually and from screen readers: h5bp.com/u + */ + +.hidden { + display: none !important; + visibility: hidden; +} + +/* + * Hide only visually, but have it available for screen readers: h5bp.com/v + */ + +.visuallyhidden { + border: 0; + clip: rect(0 0 0 0); + height: 1px; + margin: -1px; + overflow: hidden; + padding: 0; + position: absolute; + width: 1px; +} + +/* + * Extends the .visuallyhidden class to allow the element to be focusable + * when navigated to via the keyboard: h5bp.com/p + */ + +.visuallyhidden.focusable:active, +.visuallyhidden.focusable:focus { + clip: auto; + height: auto; + margin: 0; + overflow: visible; + position: static; + width: auto; +} + +/* + * Hide visually and from screen readers, but maintain layout + */ + +.invisible { + visibility: hidden; +} + +/* + * Clearfix: contain floats + * + * For modern browsers + * 1. The space content is one way to avoid an Opera bug when the + * `contenteditable` attribute is included anywhere else in the document. + * Otherwise it causes space to appear at the top and bottom of elements + * that receive the `clearfix` class. + * 2. The use of `table` rather than `block` is only necessary if using + * `:before` to contain the top-margins of child elements. + */ + +.clearfix:before, +.clearfix:after { + content: " "; /* 1 */ + display: table; /* 2 */ +} + +.clearfix:after { + clear: both; +} diff --git a/source/assets/css/vendor/html5boilerplate/_print.scss b/source/assets/css/vendor/html5boilerplate/_print.scss new file mode 100644 index 0000000..8ab9047 --- /dev/null +++ b/source/assets/css/vendor/html5boilerplate/_print.scss @@ -0,0 +1,67 @@ +/* ========================================================================== + Print styles. + Inlined to avoid the additional HTTP request: h5bp.com/r + ========================================================================== */ + +@media print { + * { + background: transparent !important; + color: #000 !important; /* Black prints faster: h5bp.com/s */ + box-shadow: none !important; + text-shadow: none !important; + } + + a, + a:visited { + text-decoration: underline; + } + + a[href]:after { + content: " (" attr(href) ")"; + } + + abbr[title]:after { + content: " (" attr(title) ")"; + } + + /* + * Don't show links that are fragment identifiers, + * or use the `javascript:` pseudo protocol + */ + + a[href^="#"]:after, + a[href^="javascript:"]:after { + content: ""; + } + + pre, + blockquote { + border: 1px solid #999; + page-break-inside: avoid; + } + + thead { + display: table-header-group; /* h5bp.com/t */ + } + + tr, + img { + page-break-inside: avoid; + } + + img { + max-width: 100% !important; + } + + p, + h2, + h3 { + orphans: 3; + widows: 3; + } + + h2, + h3 { + page-break-after: avoid; + } +} diff --git a/source/assets/css/vendor/html5boilerplate/_responsive.scss b/source/assets/css/vendor/html5boilerplate/_responsive.scss new file mode 100644 index 0000000..59e496c --- /dev/null +++ b/source/assets/css/vendor/html5boilerplate/_responsive.scss @@ -0,0 +1,16 @@ +/* ========================================================================== + EXAMPLE Media Queries for Responsive Design. + These examples override the primary ('mobile first') styles. + Modify as content requires. + ========================================================================== */ + +@media only screen and (min-width: 35em) { + /* Style adjustments for viewports that meet the condition */ +} + +@media print, + (-o-min-device-pixel-ratio: 5/4), + (-webkit-min-device-pixel-ratio: 1.25), + (min-resolution: 120dpi) { + /* Style adjustments for high resolution devices */ +}