Skip to content
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

Bulletproof background images #42

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Creativenauts
Copy link

@Creativenauts Creativenauts commented Feb 23, 2017

Custom helper that adds bulletproof background images to your email templates.

Based on https://backgrounds.cm/

Usage

{{#bg-img src="assets/img/image.jpg" classes="hero-header" imgwidth="900" imgheight="520" bgcolor="#212831" top_padding="30" bottom_padding="30"}}Your Content Here{{/bg-img}}

Options

  • src: Path to your background image
  • classes: Adds custom classes for custom css styling
  • imgwidth: Sets the width for Outlooks <v:rect> tag.
  • imgheight: Sets the height for Outlooks <v:rect> tag.
  • bgcolor: Sets background color for the block of code. Must be hex value (#212831)
  • top_padding: Adds padding to the top of the background image block
  • bottom_padding: Adds padding to the of bottom the background image block.
  • fitcontent: Sets mso-fit-shape-to-text:true. Use at your own risk.

Example

bg

Custom helper that adds bulletproof background images to your email templates.

Based on https://backgrounds.cm/

## Usage

```{{#bg-img src="assets/img/image.jpg" classes="hero-header" imgwidth="900" imgheight="520" bgcolor="#212831" top_padding="30" bottom_padding="30"}}Your Content Here{{/bg-img}}```

## Options

* **src:** Path to your background image
* **classes:** Adds custom classes to main <table> tag for custom css styling
* **imgwidth:** Sets the width for Outlooks <v:rect> tag.
* **imgheight:** Sets the height for Outlooks <v:rect> tag.
* **bgcolor:** Sets background color for the block of code. Must be hex value (#212831)
* **top_padding:** Adds padding to the top the background image block
* **bottom_padding:** Adds padding to the bottom the background image block.
* **fitcontent:** Sets mso-fit-shape-to-text:true. Use at your own risk.

## Example

![bg](https://cloud.githubusercontent.com/assets/4481041/23200874/c8919c4c-f8a4-11e6-8da5-c946258f0f06.jpg)
@kball
Copy link
Contributor

kball commented Apr 27, 2017

Love this! We think this would actually be better as an inky tag than a helper, that way folks who aren't using the template could still use it. Was there a reason you did it here instead? Could you set it up as an inky tag here? https://github.com/zurb/inky

@Creativenauts
Copy link
Author

@kball It could probably be an Inky tag as well. I just wasn't very familiar with the framework at the time of creating this for my project. I haven't gotten back around to messing with zurb since I finished the project I had been working on. I will be working on a few more projects for our platform soon which I will investigate adding it to inky.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants