emogrifier
==========

Converts CSS styles into inline style attributes in your HTML code.

# Emogrifier

_n. e•mog•ri•fi•er [\ē-'mä-grƏ-,fī-Ər\] - a utility for changing completely the nature or appearance of HTML email, esp. in a
particularly fantastic or bizarre manner_

Emogrifier converts CSS styles into inline style attributes in your HTML code. This ensures proper display on email and mobile
device readers that lack stylesheet support.

This utility was developed as part of [Intervals](http://www.myintervals.com/) to deal with the problems posed by certain email
clients (namely Outlook 2007 and Google Gmail) when it comes to the way they handle styling contained in HTML emails. As many web
developers and designers already know, certain email clients are notorious for their lack of CSS support. While attempts are being
made to develop common [email standards](http://www.email-standards.org/), implementation is still a ways off.

The primary problem with uncooperative email clients is that most tend to only regard inline CSS, discarding all `<style>`
elements and links to stylesheets in `<link>` elements. Emogrifier solves this problem by converting CSS styles into inline style
attributes in your HTML code.

## How it Works

Emogrifier automagically transmogrifies your HTML by parsing your CSS and inserting your CSS definitions into tags within your
HTML based on your CSS selectors.

## Caveats

* NEW: Emogrifier will grab existing inline style attributes and will grab `<style>` blocks from your HTML, but it will not grab
  CSS files referenced in <link> elements (the problem email clients are going to ignore these tags anyway, so why leave them in your
  HTML?).
* Even with styles inline, certain CSS properties are ignored by certain email clients. For more information, review documentation
  here.
* All CSS attributes that apply to a node will be applied, even if they are redundant. For example, if you define a font attribute
  and a font-size attribute, both attributes will be applied to that node (in other words, the more specific attribute will not be
  combined into the more general attribute).
* There's a good chance you might encounter problems if your HTML is not well formed and valid (DOMDocument might complain). If
  you get problems like this, consider running your HTML through Tidy before you pass it to Emogrifier.
* Finally, Emogrifier only supports CSS1 level selectors and a few CSS2 level selectors (but not all of them). It does not support
  pseudo selectors (Emogrifier works by converting CSS selectors to XPath selectors, and pseudo selectors cannot be converted
  accurately).

Copy information from the Pelago site into the Readme.
[TASK] Copy information from the Pelago site into the Readme.

There is some information on Emogrifier at
http://www.pelagodesign.com/sidecar/emogrifier/ .

These information should also be available in the README.md.
