-
Notifications
You must be signed in to change notification settings - Fork 209
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
Horizontal Ruler Helper #40
base: master
Are you sure you want to change the base?
Conversation
Custom helper that adds a horizontal ruler to your email templates.
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.
If anyone has suggestions on how to optimize the code, please let me know. Thanks!
src/helpers/ruler.js
Outdated
// Trim Non-Numberic Chracters | ||
String.prototype.trimUnit = function() { return this.replace(/\D/g, ''); } | ||
|
||
// Variables & Options |
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.
Please Indent properly .... Indentation should have 2 line spaces only instead of a tab.
If you are using editor like sublime text or atom , you can make your line space from 4 to 2 by customizing it like this below example of sublime!
"tab_size": 2,
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.
@IamManchanda thanks, I just checked preferences and tab_size is already set to 2 and translate tabs to spaces is set to true as well.
{
// The number of spaces a tab is considered equal to
"tab_size": 2,
// Set to true to insert spaces when tab is pressed
"translate_tabs_to_spaces": true,
// Set to false to disable detection of tabs vs. spaces on load
"detect_indentation": false,
}
Changed spacing from tab to spaces and size from 4 to 2.
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.
cool now @canterberrie for review,
@IamManchanda :/ guess I need to create new fork / branch for 716. Sorry, still trying to get the hang of this. |
and why is that @DerekBess ? |
@IamManchanda I assume since this has both of my files for both pull requests it could be an issue? |
oh yes an issue then! |
@IamManchanda I will remove that pull request here shortly, have to pick my truck up from the body shop and then I'll work on it a bit more. Thanks for the help! |
@IamManchanda Okay, I closed the other PR. |
I added the option to align the ruler left, right and center. I also updated the spacer variable and ruler output code block. I'm looking for a way to eliminate the use of a spacer.gif image in order for the email to render pixel perfect in outlook. Any suggestions on how to achieve perfect pixel height with empty cells in outlook?
I just added the option of aligning the ruler left, right and center. Currently investigating a way to eliminate the use of a spacer.gif image for outlook. |
I managed to find a way to eliminate the need for the spacer.gif image that works in Outlook.
Updated PR as I have found a way to eliminate the need for a spacer.gif image. |
💯 |
@bufordtaylor thanks brother. Take a look at the code, let me know how shitty it is from your heart ;) |
@DerekBess Any reason not to make this an inky tag? |
Custom helper that adds a horizontal ruler to your email templates.
Usage
{{ruler align="center" color="#ec6225" width="60px" height="3px" spacing="15px"}}
Options
Example