Repository: foundation/foundation-emails
Branch: develop
Commit: 7a37ae4cad4f
Files: 130
Total size: 328.4 KB
Directory structure:
gitextract_ldk09dof/
├── .browserslistrc
├── .github/
│ ├── ISSUE_TEMPLATE.md
│ └── PULL_REQUEST_TEMPLATE.md
├── .gitignore
├── .npmignore
├── .nvmrc
├── .sass-lint.yml
├── CONTRIBUTING.md
├── LICENSE.md
├── README.md
├── bower.json
├── dist/
│ └── foundation-emails.css
├── docs/
│ ├── assets/
│ │ ├── js/
│ │ │ ├── codeSample.js
│ │ │ ├── docs.ad.js
│ │ │ └── docs.js
│ │ └── scss/
│ │ ├── _code.scss
│ │ ├── _compatibility.scss
│ │ ├── _course-callout.scss
│ │ └── docs.scss
│ ├── layouts/
│ │ ├── component.html
│ │ └── default.html
│ ├── pages/
│ │ ├── alignment.md
│ │ ├── button.md
│ │ ├── callout.md
│ │ ├── compatibility.md
│ │ ├── css-guide.md
│ │ ├── gem-guide.md
│ │ ├── global.md
│ │ ├── grid.md
│ │ ├── index.md
│ │ ├── inky.md
│ │ ├── media-query.md
│ │ ├── menu.md
│ │ ├── migration.md
│ │ ├── panini.md
│ │ ├── sass-guide.md
│ │ ├── sass.md
│ │ ├── spacer.md
│ │ ├── styling.md
│ │ ├── thumbnail.md
│ │ ├── tips-tricks.md
│ │ ├── typography.md
│ │ ├── visibility.md
│ │ ├── wrapper.md
│ │ └── zurb-stack.md
│ └── partials/
│ ├── component-list.html
│ ├── course-callout.html
│ ├── footer.html
│ ├── mobile-navigation.html
│ ├── navigation.html
│ └── off-canvas.html
├── gem/
│ ├── .gitignore
│ ├── .rspec
│ ├── .travis.yml
│ ├── Gemfile
│ ├── LICENSE.md
│ ├── README.md
│ ├── Rakefile
│ ├── bin/
│ │ ├── console
│ │ └── setup
│ ├── foundation-emails.gemspec
│ ├── lib/
│ │ ├── foundation_emails/
│ │ │ ├── engine.rb
│ │ │ └── version.rb
│ │ └── foundation_emails.rb
│ ├── spec/
│ │ ├── foundation/
│ │ │ └── emails_spec.rb
│ │ └── spec_helper.rb
│ └── vendor/
│ └── assets/
│ └── stylesheets/
│ └── _foundation-emails.scss
├── gulpfile.js
├── migration.md
├── package.json
├── scss/
│ ├── _global.scss
│ ├── components/
│ │ ├── _alignment.scss
│ │ ├── _button.scss
│ │ ├── _callout.scss
│ │ ├── _code.scss
│ │ ├── _media-query.scss
│ │ ├── _menu.scss
│ │ ├── _normalize.scss
│ │ ├── _outlook-first.scss
│ │ ├── _thumbnail.scss
│ │ ├── _typography.scss
│ │ └── _visibility.scss
│ ├── foundation-emails.scss
│ ├── grid/
│ │ ├── _block-grid.scss
│ │ └── _grid.scss
│ ├── settings/
│ │ └── _settings.scss
│ └── util/
│ └── _util.scss
├── templates/
│ ├── basic.html
│ ├── drip.html
│ ├── hero.html
│ ├── marketing.html
│ ├── newsletter-2.html
│ ├── newsletter.html
│ ├── order.html
│ ├── password.html
│ ├── sidebar-hero.html
│ ├── sidebar.html
│ └── welcome.html
└── test/
└── visual/
├── _template.html
└── pages/
├── alignment.html
├── anchor.html
├── attributes.html
├── block-inky.html
├── button-expanded-inky.html
├── button-hollow.html
├── button-inky.html
├── callout-in-grid.html
├── center-width.html
├── container-radius.html
├── expander.html
├── fluid-header.html
├── grid-collapse.html
├── grid-inky.html
├── grid-nested-inky.html
├── grid-with-callouts-inky.html
├── grid.html
├── hr.html
├── images.html
├── index.html
├── inliner-bugs.html
├── layout-break-center.html
├── list.html
├── menu-inky.html
├── offset-inky.html
├── outlook-image-width.html
├── spacer.html
├── spacing.html
├── thumbnail.html
├── type.html
└── visibility.html
================================================
FILE CONTENTS
================================================
================================================
FILE: .browserslistrc
================================================
# Browsers that we support
last 2 versions
ie >= 9
ios >= 7
android >= 4.4
================================================
FILE: .github/ISSUE_TEMPLATE.md
================================================
**How can we reproduce this bug?**
Write out the HTML (or Inky code) that causes the issue.
**What did you expect to happen?**
**What happened instead?**
**What email clients does this happen in?**
================================================
FILE: .github/PULL_REQUEST_TEMPLATE.md
================================================
Before submitting a pull request, make sure it's targeting the right branch:
- For fixes to Ink 1.0, use `master`.
- For fixes to Foundation for Emails 2, use `v2.0`.
Happy coding! :)
================================================
FILE: .gitignore
================================================
*.DS_Store
node_modules/
.sass-cache/
npm-debug.log
temp/
_build/
inky
*.swp
.templates
.download
foundation-emails.zip
bower_components
.idea/
================================================
FILE: .npmignore
================================================
_build
docs
gem
inky
testing
================================================
FILE: .nvmrc
================================================
20
================================================
FILE: .sass-lint.yml
================================================
files:
include: 'scss/**/*.scss'
options:
formatter: stylish
merge-default-rules: false
rules:
border-zero:
- 1
- convention: zero
brace-style:
- 1
- allow-single-line: false
class-name-format:
- 1
- convention: '([a-z0-9]+-?)+'
clean-import-paths:
- 1
- filename-extension: false
leading-underscore: false
empty-line-between-blocks:
- 1
- ignore-single-line-rulesets: true
extends-before-declarations: 1
extends-before-mixins: 1
final-newline:
- 1
- include: true
force-attribute-nesting: 1
force-element-nesting: 1
force-pseudo-nesting: 1
function-name-format:
- 1
- allow-leading-underscore: true
convention: hyphenatedlowercase
hex-length:
- 1
- style: short
hex-notation:
- 1
- style: lowercase
id-name-format:
- 1
- convention: '([a-z0-9]+-?)+'
indentation:
- 1
- size: 2
leading-zero:
- 1
- include: true
mixin-name-format:
- 1
- allow-leading-underscore: true
convention: hyphenatedlowercase
mixins-before-declarations: 1
nesting-depth:
- 1
- max-depth: 3
no-color-keyword: 1
no-color-literals: 1
no-css-comments: 0
no-debug: 1
no-duplicate-properties: 1
no-empty-rulesets: 1
no-ids: 1
no-important: 0
no-invalid-hex: 1
no-mergeable-selectors: 1
no-misspelled-properties:
- 1
- extra-properties: []
no-qualifying-elements:
- 0
- allow-element-with-attribute: false
allow-element-with-class: false
allow-element-with-id: false
no-trailing-zero: 1
no-url-protocols: 1
placeholder-in-extend: 1
placeholder-name-format:
- 1
- convention: '([a-z0-9]+-?)+'
property-sort-order:
- 0
- ignore-custom-properties: false
quotes:
- 1
- style: single
shorthand-values: 1
single-line-per-selector: 0
space-after-bang:
- 1
- include: false
space-after-colon:
- 1
- include: true
space-after-comma: 1
space-before-bang:
- 1
- include: true
space-before-brace:
- 1
- include: true
space-before-colon: 1
space-between-parens:
- 1
- include: false
trailing-semicolon: 1
url-quotes: 1
variable-for-property:
- 0
- properties: []
variable-name-format:
- 1
- allow-leading-underscore: true
convention: hyphenatedlowercase
zero-unit: 1
================================================
FILE: CONTRIBUTING.md
================================================
# Contributing to Foundation
Foundation loves its community! We always want to hear from our users, whether they're reporting bugs, suggesting new features, or even adding them themselves.
## Reporting Bugs
[Open a new issue](https://github.com/foundation/foundation-emails/issues/new) to report a problem you're having with Foundation for Apps. When writing your issue, keep these things in mind:
- **Be descriptive.** If you can, upload a screenshot of problem you're having, or copy and paste any JavaScript or command line errors you encounter. Being detailed will help us hone in on the problem faster.
- **Post your code.** It's very helpful to see any HTML, Sass, or JavaScript you've written that you think may be causing the problem. In some cases, we might be able to fix your problem just by fixing your code.
- **Help us recreate it.** If your problem is complex, tell us the steps needed to recreate the issue. Sometimes we need to see the problem for ourselves, in our own testing environment, so we can more easily debug it.
## Editing the Documentation
The documentation is compiled by a tool called [Supercollider](https://github.com/gakimball/supercollider). Each page is compiled from 1–2 sources:
- A Markdown file under `docs/pages/`.
- If it's a Sass component, the relevant Sass file inside `scss/` is scanned for special [SassDoc](http://sassdoc.com/) comments.
Each page is rendered in one big [Handlebars template](https://github.com/foundation/foundation-docs/blob/master/templates/component.html) that takes in all of the above data.
Much of the guts of the documentation are stored in an external codebase called [foundation-docs](https://github.com/foundation/foundation-docs). This is code that's shared between the documentation for all three Foundation frameworks, including:
- CSS specific to the documentation
- The Handlebars template used to build pages
- A series of Handlebars helpers for the template
- A custom Markdown parser used when parsing pages
- A script that generates the search results for documentation pages
To hack on this repo locally, clone the foundation-docs repo into a folder adjacent to this repo's folder on your machine. Then run `npm link ../foundation-docs` to wire the two together.
## Submitting Pull Requests
If you think you can solve a problem yourself, or want to implement a new feature, go for it! Follow these guidelines to make the most killer PR ever.
- **Target the right branch.** So we can properly follow [semantic versioning](http://semver.org/), be sure to develop your pull request in the right branch:
- Ink 1.0 changes: `v1.0`
- Foundation for Emails 2.0+ bug fixes: `develop`
- New features should be pointed to: `v2.3`
- **Test, test, and test.** The Foundation frameworks are used by thousands and thousands of designers and developers, so making sure your changes work in every email client is important! Please test bug fixes or new features in Litmus, or another email testing service.
## Help Wanted
Want something to work on? Let us guide you in the right direction.
- Browse the [Help Wanted](https://github.com/foundation/foundation-emails/labels/help%20wanted) issue to see bugs or features we've asked for the community's help on. Feel free to implement them yourself as a pull request!
================================================
FILE: LICENSE.md
================================================
Copyright (c) 2017 Foundation, inc.
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
================================================
FILE: README.md
================================================
# [Foundation for Emails](https://get.foundation/emails)
[](https://www.npmjs.org/package/foundation-emails)
[](https://www.npmjs.org/package/foundation-emails)
[](https://badge.fury.io/rb/foundation_emails)
[](https://www.npmjs.org/package/foundation-emails)
[](https://cdnjs.com/libraries/foundation-emails)
Foundation for Emails (previously known as Ink) is a framework for creating responsive HTML emails that work in any email client — even Outlook. Our HTML/CSS components have been tested across every major email client to ensure consistency. And with the [Inky](https://github.com/foundation/inky) templating language, writing HTML emails is now even easier.
## Getting Started
The main way to get started is with our [email template stack](https://github.com/foundation/foundation-emails-template). To use the stack, you'll need [Node.js](https://nodejs.org/en/) no greater than version 10 installed on your machine.
`nvm` installation instructions can be found [here](https://github.com/nvm-sh/nvm#install--update-script)
To set up the emails template, run these commands:
```bash
git clone https://github.com/foundation/foundation-emails-template project
cd project
nvm install 10
nvm use 10
npm install
```
Then run `npm start` to run the project. A new browser window will open with a BrowserSync server showing the finished files.
Run `npm run build` to do a full email inlining process.
#### Using the Ruby gem
**foundation_emails** is a gem that enables you to use Foundation for Emails assets within a Rails project. To install in your app:
1. Add the following line to your Gemfile:
```ruby
gem 'foundation_emails'
```
2. Then execute:
```bash
bundle install
```
3. Import Foundation for Emails in your emails' stylesheet(s):
```scss
// app/assets/stylesheets/your_emails_stylesheet.scss
@import "foundation-emails";
```
Adding Inky's templating capabilities to Rails is easy thanks to the [**inky-rb**](https://github.com/foundation/inky-rb) gem, which bundles `foundation_emails` by default.
## Documentation
**Check out our [Migration Guide](https://github.com/foundation/foundation-emails/blob/master/migration.md) for upgrading an existing template or for more in-depth code examples.**
Foundation for Emails 2.0 documentation and framework are on the `develop` branch and you can compile it on your own machine.
Run these commands to set up the documentation:
```bash
git clone https://github.com/foundation/foundation-emails.git
cd foundation-emails
```
Foundation for Emails 2.0 documentation is on the `develop` branch.
```bash
git fetch
git checkout develop
npm install
```
Then run `npm start` to compile the documentation. When it finishes, a new browser window will open pointing to a BrowserSync server displaying the documentation.
## Testing
Run `npm run test:visual` to compile the visual regression tests. All of the pages under `test/visual/pages` are compiled and inlined. From there, they can be uploaded to Litmus for testing.
## Inky
[Inky](https://github.com/foundation/inky) is our new templating language that converts simple HTML into the complex tables required for email layout.
The parser converts a set of custom HTML tags, expanding them out into full HTML syntax. Below is a list of every custom element.
### Grid
```html
```
### Block Grid
```html
We use these mixins to build the final CSS output of this component. You can use the mixins yourself to build your own class structure out of our components.
Use these options to customize an instance of {{title}}. Plugin options can be set as individual data attributes, one combined data-options attribute, or as an object passed to the plugin's constructor. Learn more about how JavaScript plugins are initialized.
Building Blocks is a Foundation-curated resource with useful code snippets that use Foundation components. Here are a few for this component:
{{/if}}
{{!-- End container for docs --}}
{{!-- End container for docs and table of contents --}}
================================================
FILE: docs/layouts/default.html
================================================
Foundation for Emails 2 Docs{{#unlesspage 'index'}} | {{title}}{{/unlesspage}}
{{> off-canvas}}
{{> navigation}}
{{> mobile-navigation}}
{{> body}}
{{> component-list}}
{{> footer}}
================================================
FILE: docs/pages/alignment.md
================================================
---
title: Alignment
description: Centering, images, text, buttons, and menus in HTML emails made easy.
---
Foundation includes a handful of helpful alignment classes to add common positioning behaviors to elements.
---
## Text Alignment
You can align text with the `.text-x` classes. These classes will apply to the large breakpoint as well as the small.
```inky_example
Left (default)
center
right
```
If you need to change text alignment only on the small breakpoint, you can use the `.small-text-x` classes.
```inky_example
Left on small
Center on small
Right on small
```
You can combine these classes to override the behavior on the small breakpoint.
```inky_example
Center, small left
Right, small center
```
---
## Centering Images
Just wrap the `
` around an image you’ll be good to go. Inky will handle the magic behind the scenes! In the CSS version, you’ll add a `.float-center` class, `align="center"` attribute and wrap a <center> tag to make sure things are centered.
```inky_example
```
So to be clear: with Inky you only need to wrap an image in `
` tag to reliably center it.
In the CSS version, our centering recipe includes three ingredients:
- `.float-center` class on the `` element
- `align="center"` attribute on the `` element
- Wrap the `` with `
` tags (needed for Outlook 2007, 2010, and 2011)
Also, it's not really a float, but the `.float-center` class to an element to engage the automatic margin centering trick. Note that this will only work on elements with an absolute width, which means not a percentage or auto width.
If you need to center an image only on mobile clients, you can apply the `.small-float-center` class. A good use case would be centering an image smaller than the full column width on devices like an iPhone 5, iPhone 6, and Android 4.4.
```inky_example
What is the deal?
Sweet beast sun bathe or chase mice rub face on everything or leave dead animals as gifts for mark territory play time.
```
---
## Aligning Images Left and Right
You can also align images to the left or the right.
```inky_example
```
---
## Centering a Button
Wrap the button with `
` tags to center it.
```inky_example
```
---
## Centering Columns
Tables by nature take up as much space is available to them. Because of this, centering columns can be done by adding empty columns to left and right of the column to be centered.
```inky_example
Centering a columnCentering a columnCentering a column
```
If you don't add a size attribute like `small="x"` then the columns will be equal width.
---
## Centering a Menu
Centering the menu is a common practice. Wrapping the menu in `
` tags will achieve this.
```inky_example
```
---
## Vertical Alignment
You can vertically align your content within columns by using `valign` attribute. The available values are `top`, `middle`, and `bottom`.
```inky_example
Bottom
HEADLINE
SUBHEADLINE
```
================================================
FILE: docs/pages/button.md
================================================
---
title: Button
description: Buttons are convenient tools when you need more traditional actions. To that end, Foundation has many easy to use button styles that you can customize or override to fit your needs.
sass: scss/components/_button.scss
---
Creating a bullet-proof button that works in all email clients requires a table nested inside of a table. Put the class `.button` on the outer `