-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Various <hr> fixes #679
Various <hr> fixes #679
Conversation
scss/components/_typography.scss
Outdated
|
||
table { | ||
width: $hr-width !important; | ||
margin: 0 auto; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Margin
(with capital M
) not required, since Outlook won't obey this anyway.
scss/components/_typography.scss
Outdated
} | ||
|
||
table { | ||
width: $hr-width !important; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tried without !important
, went to 100% width.
scss/components/_typography.scss
Outdated
@@ -297,20 +297,32 @@ pre { | |||
} | |||
|
|||
// Horizontal rule | |||
table.hr { | |||
table.hr, | |||
table.h-line { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Support table.h-line
as per foundation/inky#46
Poke @kball |
To emulate the behavior in menus, maybe the structure ought to be a <table class="hr">
<tr>
<td>
<table><tr><th> </th></tr></table>
</td>
</tr>
</table> |
75bf074
to
d340bf4
Compare
…tion#648); make <hr>s obey -width (foundation#678); Make <hr>s obey -margin in Outlook 2007/10/13 (foundation#682)
07eec85
to
1b80398
Compare
Merge please |
I ended up fixing this by putting together a pretty simple partial called "hr.hbs". As far as I know, this works in all email clients, including Outlook 2016. Normal Divider Partial{{#if underscore}}
<table width="65" cellpadding="0" cellspacing="0" border="0" class="underscore">
<tr><td height="4"> </td></tr>
</table>
{{else}}
{{#if margin}}<spacer size="{{margin}}"></spacer>{{/if}}
<table width="{{#if width}}{{width}}{{else}}100%{{/if}}" cellpadding="0" cellspacing="0" border="0" class="divider">
<tr>
<td height="1" style="{{#if height}}border-top-width:{{height}}px;{{/if}} {{#if color}}border-color:{{color}}{{/if}}"> </td>
</tr>
</table>
{{/if}}
{{#if margin}}<spacer size="{{margin}}"></spacer>{{/if}} Divider CSStable.underscore {
width: 65px !important;
Margin-left: auto;
Margin-right: auto;
}
table.divider td, table.underscore td {
border-top: $hr-border;
font-size: $hr-height;
height: $hr-height;
line-height: $hr-height;
}
hr.underscore, table.underscore td {
border-top: 4px solid $black;
}
table.underscore td {
font-size: 4px;
height: 4px;
line-height: 4px;
} This partial accepts variables for margins, color, height, and width. Here's a few examples of how to add it to your templates. Simplest InitNote: If you don't provide any values, it will use the values from $hr-border, $hr-height, etc. Passing ValuesYou can pass values to it as well. For example: Title UnderscoresYou can add an underscore value, to add nice little underscores beneath titles. <h1>Start the New Year off right!</h1>
{{> hr underscore=true }} I have not added all of the width, height, and color variables to the "title underscores", because these are controlled by different color email themes. For example, here's a dead simple css theme I set up. You'll need to add these classes to your templates: html.theme-blue, html.theme-blue body, html.theme-blue .body .content {
background: lighten($blue, 35%);
background-color: lighten($blue, 35%);
h1, .text-color {color: $blue;}
hr.underscore, .underscore td {border-top-color: $blue;}
} |
Fix margin around
<hr>
s (#647)Make
<hr>
s 0-height (#648)Make
<hr>
s obey$hr-width
(#678)Make
<hr
>s obey$hr-margin
in Outlook 2007/10/13 (#682)Add
h-line
mixin to create different horizontal rules/dividersThe code required to render these horizontal rules (and this differs from the proposed Inky
<h-line>
code, so that may need to be updated as well):Also, in order for this to work,
$hr-margin
will need to be a single value rather than something like20px auto
; Outlook and others don't obeymargin
on tables, so this is instead handled withpadding-bottom
(on the outerth
) andpadding-top
(on the innertd
withborder-bottom
).I've also added support for the
table.h-line
selector, which looks like it will be used in an upcoming Inky release when<h-line>
is implemented. (foundation/inky#46)Also addresses #496 and #554, for which some of my Issues above are potential duplicates.