Thanks to Igor who emailed me and made me aware, you can't put pseudo classes in style attributes in HTML. I.e. this does not work:


<a href="#" style="color:pink :hover{color:red}">Sample Link</a>

See for yourself: Sample Link

Note how it does not become red when you hover over the link above.
This is what premailer used to do. Until yesterday.

BEFORE:


>>> from premailer import transform
>>> print transform('''
... <html>
... <style>
... a { color: pink }
... a:hover { color: red }
... </style>
... <a href="#">Sample Link</a>
... </html>
... ''')
<html><head><a href="#" style="{color:pink} :hover{color:red}">Sample Link</a></head></html>

AFTER:


>>> from premailer import transform
>>> print transform('''
... <html>
... <style>
... a { color: pink }
... a:hover { color: red }
... </style>
... <a href="#">Sample Link</a>
... </html>
... ''')
<html><head>
<style>a:hover {color:red}</style>
<a href="#" style="color:pink">Sample Link</a>
</head></html>

That's because the new default is exclude pseudo classes by default.

Thanks Igor for making me aware!

Your email will never ever be published.

Previous:
What stumped me about AngularJS May 12, 2013 AngularJS, JavaScript
Next:
In Python you sort with a tuple June 14, 2013 Python
Related by category:
Claude Opus is 10x faster than OpenAI GPT 5 at non-streaming completions July 24, 2026 Python
Best Django Redis configuration for speed and size July 19, 2026 Python
How to use a list/tuple/array in Django with a raw SQL cursor July 14, 2026 Python
Testing out vite 8 on SPA: Vite 8 is 5x faster December 6, 2025 Web development
Related by keyword:
Premailer.io July 8, 2015 Python, Web development, AngularJS, JavaScript
mincss "Clears the junk out of your CSS" January 21, 2013 Python, Web development
CSS Bloat Comparison June 3, 2016 Web development, JavaScript
This site is now 100% inline CSS and no bytes are wasted March 5, 2013 Python, Web development, Django