From: RafiBomb Date: Mon, 7 Mar 2016 22:33:44 +0000 (-0800) Subject: audits and adds settings variables to match sites X-Git-Tag: v2.0.0-rc.3~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=21cf921fc10874ebf98fa1de32842f3f8ec29b09;p=thirdparty%2Ffoundation%2Ffoundation-emails.git audits and adds settings variables to match sites --- diff --git a/gulpfile.js b/gulpfile.js index 6eb1786a..5f2591bb 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -77,7 +77,7 @@ gulp.task('settings', function() { octophant('scss/**/*.scss', { title: 'Foundation for Emails Settings', output: 'testing/src/assets/scss/_settings.scss', - sort: ['global', 'grid', 'block-grid', 'media-query', 'type'] + sort: ['global', 'grid', 'block-grid', 'type'] }); }); diff --git a/scss/_global.scss b/scss/_global.scss index 5de2f79a..a2ebb30c 100755 --- a/scss/_global.scss +++ b/scss/_global.scss @@ -58,14 +58,30 @@ $global-width: 580px !default; /// @type Length $global-width-small: 95% !default; -/// Gutter for grid elements. -/// @type length -$global-gutter: 16px !default; +/// Body background color. +/// @type Length +$body-background: $light-gray !default; /// Color for the container background /// @type Color $container-background-color: $white !default; +/// Global font color. +/// @type Color +$global-font-color: $black !default; + +/// Global font family. +/// @type Font +$body-font-family: Helvetica, Arial, sans-serif !default; + +/// Global padding. +/// @type Number +$global-padding: 16px !default; + +/// Global margin. Margin requires a capital 'M' to workin Outlook.com +/// @type Number +$global-margin: 32px !default; + /// Global raidus of radius-corners. /// @type Number $global-radius: 3px !default; diff --git a/scss/components/_button.scss b/scss/components/_button.scss index ae4b8300..d903b919 100755 --- a/scss/components/_button.scss +++ b/scss/components/_button.scss @@ -36,6 +36,10 @@ $button-color-alt: $medium-gray !default; /// @type Weight $button-font-weight: bold !default; +/// Margin around buttons. +/// @type List +$button-margin: 0 0 $global-margin 0 !default; + /// Background color of buttons. /// @type Color $button-background: $primary-color !default; @@ -44,6 +48,14 @@ $button-background: $primary-color !default; /// @type Border $button-border: 2px solid $button-background !default; +/// Border radius of buttons. Not supported by all email clients. +/// @type Number +$button-radius: $global-radius !default; + +/// Border radius of rounded buttons. Not supported by all email clients. +/// @type Number +$button-rounded: $global-rounded !default; + // Internal values for button font size // [TODO] Replace references below with map-get() calls $button-font-size-default: map-get($button-font-size, default); @@ -62,7 +74,7 @@ table.button { width: auto !important; table { - margin-bottom: 10px; + margin-bottom: $button-margin; td { width: auto !important; @@ -71,6 +83,14 @@ table.button { background: $button-background; border: 2px solid $button-background; + &.radius { + border-radius: $button-radius; + } + + &.rounded { + border-radius: $button-rounded; + } + a { font-family: $body-font-family; font-size: $button-font-size-default; @@ -80,6 +100,7 @@ table.button { display: inline-block; padding: $button-padding-default; border: 0px solid $button-background; + border-radius: $button-radius; } } } diff --git a/scss/components/_menu.scss b/scss/components/_menu.scss index 72774955..f90fb1ec 100644 --- a/scss/components/_menu.scss +++ b/scss/components/_menu.scss @@ -3,7 +3,7 @@ // Licensed under MIT Open Source //// -/// @group inline-list +/// @group menu //// /// Padding inside a menu item. diff --git a/scss/components/_normalize.scss b/scss/components/_normalize.scss index 925ac173..65dec698 100755 --- a/scss/components/_normalize.scss +++ b/scss/components/_normalize.scss @@ -6,16 +6,6 @@ /// @group normalize //// -/// Color of a divider. -/// @type Color -$hr-background: $medium-gray !default; - -/// Height of a divider. -/// @type Length -$hr-height: 1px !default; - -$paragraph-margin-bottom: 10px !default; - #outlook a { padding: 0; } @@ -95,9 +85,4 @@ table, tr, td { text-align: left; } -hr { - color: $hr-background; - background-color: $hr-background; - height: $hr-height; - border: none; -} + diff --git a/scss/components/_type.scss b/scss/components/_type.scss index fd783617..60cdb379 100755 --- a/scss/components/_type.scss +++ b/scss/components/_type.scss @@ -6,25 +6,21 @@ /// @group typography //// -/// Global font color. -/// @type Color -$global-font-color: $black !default; - -/// Global font family. -/// @type Font -$body-font-family: Helvetica, Arial, sans-serif !default; - /// Global font weight. /// @type Keyword $global-font-weight: normal !default; +/// Global font weight. +/// @type Keyword +$header-color: inherit !default; + /// Global line height. /// @type Number $global-line-height: 1.3 !default; /// Font size of body text. /// @type Number -$body-font-size: 14px !default; +$global-font-size: 14px !default; /// Line height of body text. /// @type Number @@ -62,6 +58,10 @@ $h5-font-size: 24px !default; /// @type Number $h6-font-size: 20px !default; +/// Margin bottom of `

` through `

` elements. +/// @type Number +$header-margin-bottom: 10px !default; + /// Margin bottom of paragraphs. /// @type Number $paragraph-margin-bottom: 10px !default; @@ -72,16 +72,48 @@ $small-font-size: 10px !default; /// Font size of lead paragraphs. /// @type Number -$lead-font-size: 18px !default; +$lead-font-size: $global-font-size * 1.25 !default; /// Line height of lead paragraphs. /// @type Number -$lead-line-height: 21px !default; +$lead-line-height: 1.6 !default; /// Padding inside paragraphs. /// @type Number $text-padding: 10px !default; +/// Default line height for subheaders. +/// @type Number +$subheader-lineheight: 1.4 !default; + +/// Default font color for subheaders. +/// @type Color +$subheader-color: $dark-gray !default; + +/// Default font weight for subheaders. +/// @type String +$subheader-font-weight: $global-font-weight !default; + +/// Default top margin for subhheaders. +/// @type Number +$subheader-margin-top: 4px !default; + +/// Default bottom margin for subheaders. +/// @type Number +$subheader-margin-bottom: 8px !default; + +/// Maximum width of a divider. +/// @type Number +$hr-width: $global-width !default; + +/// Default border for a divider. +/// @type List +$hr-border: 1px solid $medium-gray !default; + +/// Default margin for a divider. +/// @type Number | List +$hr-margin: 20px auto !default; + /// Text decoration for anchors. /// @type Keyword $anchor-text-decoration: none !default; @@ -102,6 +134,10 @@ $anchor-color-hover: darken($primary-color, 10%) !default; /// @type Color $anchor-color-active: $anchor-color-hover !default; +/// Default font size for statistic numbers. +/// @type Number +$stat-font-size: 40px !default; + body, table.body, h1, @@ -129,8 +165,10 @@ h3, h4, h5, h6 { + header: $header-color; word-break: normal; font-family: $header-font-family; + Margin-bottom: $header-margin-bottom; } h1 { @@ -162,17 +200,25 @@ table.body, p, td, th { - font-size: $body-font-size; + font-size: $global-font-size; line-height: $body-line-height; } p { - margin-bottom: $paragraph-margin-bottom; + Margin-bottom: $paragraph-margin-bottom; &.lead { font-size: $lead-font-size; line-height: $lead-line-height; } + + &.subheader { + Margin-top: $subheader-margin-top; + Margin-bottom: $subheader-margin-bottom; + font-weight: $subheader-font-weight; + line-height: $subheader-lineheight; + color: $subheader-color; + } } small { @@ -229,3 +275,28 @@ pre { } } } + +// Horizontal rule + +hr { + max-width: $hr-width; + height: 0; + border-right: 0; + border-top: 0; + border-bottom: $hr-border; + border-left: 0; + Margin: $hr-margin; + clear: both; +} + +// Use to style a large number to display a statistic +.stat { + font-size: $stat-font-size; + line-height: 1; + + p + & { + Margin-top: -16px; + } +} + + diff --git a/scss/grid/_grid.scss b/scss/grid/_grid.scss index ef174298..e196cf43 100755 --- a/scss/grid/_grid.scss +++ b/scss/grid/_grid.scss @@ -10,31 +10,27 @@ /// @type Number $grid-column-count: 12 !default; -/// Default padding for the top of the wrapper. -/// @type Number -$wrapper-padding-top: 10px !default; +/// Gutter for grid elements. +/// @type length +$global-gutter: 16px !default; /// Default padding for the bottom of a column. /// @type Number -$column-padding-bottom: 16px !default; +$column-padding-bottom: $global-padding !default; /// Default padding for the right of a sub-column. /// @type Number $sub-column-padding-right: $global-gutter / 2 !default; -/// Body background color. -/// @type Length -$body-background-color: $light-gray !default; - //For viewing email in browser html { min-height: 100%; - background: $body-background-color; + background: $body-background; } table { &.body { - background: $body-background-color; + background: $body-background; height: 100%; width: 100%; } @@ -63,7 +59,7 @@ td.column, th.columns, th.column { margin: 0 auto; - padding-left: $grid-column-gutter; + padding-left: $global-gutter; padding-bottom: $column-padding-bottom; } diff --git a/testing/src/assets/scss/_settings.scss b/testing/src/assets/scss/_settings.scss index 5fe8c2d4..ee95ad84 100644 --- a/testing/src/assets/scss/_settings.scss +++ b/testing/src/assets/scss/_settings.scss @@ -30,20 +30,21 @@ $white: #fefefe; $pre-color: #ff6908; $global-width: 580px; $global-width-small: 95%; +$global-gutter: 16px; $container-background-color: $white; +$global-padding: 16px; +$global-margin: 16px; $global-radius: 3px; $global-rounded: 500px; -$global-breakpoint: '(max-width: 580px)'; +$global-breakpoint: $global-width + $global-gutter; // 2. Grid // ------- $grid-column-count: 12; -$wrapper-padding-top: 10px; $column-padding-bottom: 16px; -$grid-column-gutter: 16px; -$sub-column-padding-right: $grid-column-gutter / 2; -$body-background-color: $light-gray; +$sub-column-padding-right: $global-gutter / 2; +$body-background: $light-gray; // 3. Block Grid // ------------- @@ -63,7 +64,7 @@ $global-font-color: $black; $body-font-family: Helvetica, Arial, sans-serif; $global-font-weight: normal; $global-line-height: 1.3; -$body-font-size: 14px; +$global-font-size: 14px; $body-line-height: 19px; $header-font-family: $body-font-family; $header-font-weight: $global-font-weight; @@ -75,9 +76,14 @@ $h5-font-size: 24px; $h6-font-size: 20px; $paragraph-margin-bottom: 10px; $small-font-size: 10px; -$lead-font-size: 18px; -$lead-line-height: 21px; -$text-padding: 10px; +$lead-font-size: $global-font-size * 1.25; +$lead-line-height: 1.6; +$subheader-lineheight: 1.4; +$subheader-color: $dark-gray; +$subheader-font-weight: $global-font-weight; +$subheader-margin-top: 0.2rem; +$subheader-margin-bottom: 0.5rem; +$stat-font-size: 2.5rem; $anchor-text-decoration: none; $anchor-color: $primary-color; $anchor-color-visited: $anchor-color; @@ -99,11 +105,13 @@ $button-font-size: ( default: 16px, large: 20px, ); +$button-margin: 0 0 $global-margin 0; $button-color: $white; $button-color-alt: $medium-gray; $button-font-weight: bold; $button-background: $primary-color; $button-border: 2px solid $button-background; +$button-radius: $global-radius; // 7. Callout // ----------