A Django app useful for inlining CSS (primarily for e-mails)
Inlining CSS is necessary for email generation and sending but is currently a surprisingly large hassle.
This library aims to make it a breeze in the Django template language.
Add
django_inlinecssto your
settings.py:
INSTALLED_APPS = ( 'django.contrib.auth', 'django.contrib.webdesign', 'django.contrib.contenttypes', '...', '...', '...', 'django_inlinecss')
{% load inlinecss %} {% inlinecss "css/extra-padding.css" %}<div class="lots-o-padding"> Something in need of styling. </div>
{% endinlinecss %}
<div style="padding-left: 10px; padding-right: 10px; padding-top: 10px;" class="lots-o-padding"> Something in need of styling. </div>
Thanks to Tanner Netterville for his efforts on Pynliner.
Thanks to Thomas Yip for his unit tests on the
soupselectmodule. These tests helped on getting the core CSS2 selectors to work.
MIT license. See LICENSE.md for more detail.