Separate out HTML5 Boilerplate styles and reformat CSS a little.

This commit is contained in:
Jina Bolton 2014-07-27 14:44:36 -07:00
parent f2a8a87820
commit 1314aad37c
10 changed files with 337 additions and 124 deletions

View File

@ -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;
}
}

View File

@ -1,11 +1,8 @@
form, form {
fieldset {
@extend %reset-margin; @extend %reset-margin;
@extend %reset-padding; @extend %reset-padding;
} }
fieldset { @extend %reset-border; }
label { label {
@extend %bold-elements; @extend %bold-elements;
@include padding-leader; @include padding-leader;

View File

@ -2,19 +2,13 @@ img {
display: inline-block; display: inline-block;
max-width: 100%; max-width: 100%;
height: auto; height: auto;
vertical-align: middle;
} }
hr { hr {
$new-spacing: ($base-line-height - 1) / $base-line-height; $new-spacing: ($base-line-height - 1) / $base-line-height;
@include leader($new-spacing); @include leader($new-spacing);
@include trailer($new-spacing); @include trailer($new-spacing);
display: block; border-top-color: $color-border;
padding: 0;
height: 1px;
border: 0 {
top: 1px solid $color-border;
}
} }
figure { figure {

View File

@ -27,14 +27,10 @@ html {
body { background: none; } body { background: none; }
@mixin theme-selection { @mixin theme-selection { background: $color-background-shade; }
background: $color-background-shade;
text-shadow: none;
}
// These have to be separate.
::-moz-selection { @include theme-selection; } ::-moz-selection { @include theme-selection; }
::selection { @include theme-selection; } ::selection { @include theme-selection; }

View File

@ -2,75 +2,116 @@
* by Team Sass Design (@teamsassdesign) * by Team Sass Design (@teamsassdesign)
*/ */
@import "compass";
@import "compass/layout";
@import "susy"; // ---------------------------------------------------------------------------
@import "breakpoint"; // VENDOR LIBRARIES
@import "normalize-rails";
@import
"compass"
, "compass/layout"
, "susy"
, "breakpoint"
;
@import "dependencies/layout"; // ---------------------------------------------------------------------------
@import "dependencies/typography"; // DEPENDENCIES
@import "dependencies/color";
@import "dependencies/animations"; @import
"dependencies/layout"
, "dependencies/typography"
, "dependencies/color"
, "dependencies/animations"
;
@import "foundation/site"; // ---------------------------------------------------------------------------
@import "foundation/block"; // FOUNDATION
@import "foundation/inline";
@import "foundation/headings"; @import
@import "foundation/lists"; "normalize-rails"
@import "foundation/tables"; , "vendor/html5boilerplate/base"
@import "foundation/forms"; , "foundation/site"
@import "foundation/code"; , "foundation/block"
@import "foundation/media"; , "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"; // COMPONENTS
@import "components/type";
@import "components/page-header"; @import
@import "components/lists"; "vendor/html5boilerplate/browsehappy"
@import "components/tables"; , "vendor/jquery-ui-1.10.4.custom"
@import "components/forms"; , "components/pop-stripe"
@import "components/buttons"; , "components/type"
@import "components/code"; , "components/page-header"
@import "components/alerts"; , "components/lists"
@import "components/progress"; , "components/tables"
@import "components/articles"; , "components/forms"
@import "components/hero-image"; , "components/buttons"
@import "components/header-image"; , "components/code"
@import "components/get-started"; , "components/alerts"
@import "components/slides"; , "components/progress"
@import "components/icons"; , "components/articles"
@import "components/logos"; , "components/hero-image"
@import "components/sass-syntax-switcher"; , "components/header-image"
, "components/get-started"
, "components/slides"
, "components/icons"
, "components/logos"
, "components/sass-syntax-switcher"
;
@import "regions/page"; // ---------------------------------------------------------------------------
@import "regions/banner"; // REGIONS
@import "regions/navigation";
@import "regions/content"; @import
@import "regions/content-primary"; "regions/page"
@import "regions/content-secondary"; , "regions/banner"
@import "regions/main"; , "regions/navigation"
@import "regions/complementary"; , "regions/content"
@import "regions/section-bottom"; , "regions/content-primary"
@import "regions/contentinfo"; , "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 "styleguide/guide";
@import "print"; // ---------------------------------------------------------------------------
// RESPONSIVE
@import "vendor/html5boilerplate/print";

View File

@ -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;
}

View File

@ -0,0 +1,10 @@
/* ==========================================================================
Browse Happy prompt
========================================================================== */
.browsehappy {
margin: 0.2em 0;
background: #ccc;
color: #000;
padding: 0.2em 0;
}

View File

@ -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;
}

View File

@ -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;
}
}

View File

@ -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 */
}