RSS Feed

Lisp Project of the Day


You can support this project by donating at:

Donate using PatreonDonate using Liberapay

Or see the list of project sponsors.


This is a small library by @shinmera. It is able to extract CSS from HTML or embed it back.

"Softdrink" could be useful, for example, to produce HTML emails. Most email software ignores external stylesheets but is able to use styles, embedded into HTML nodes.

Unfortunately, even the README examples don't work. Probably because the library's dependencies were changed in the last few years.

I've created an issue about these problems:

Hope, @shinmera will help to figure out, how to fix the problems.


Nicolas was able to fix the issue very quickly. You can install a fixed version from:

Let's try how it works!

The first example shows how to extract CSS from HTML:

POFTHEDAY> (softdrink:slurp "<div>
                               <foo id=\"bla\"
                                    style=\"foo: bar; blah: minor\" />
    foo: bar;
    blah: minor;

The second example embeds CSS into HTML and renders it into the string:

POFTHEDAY> (softdrink:pour
                <p>Hello Lisp World!</p>
             ;; This is a style to embed into HTML
             '(p :text-decoration underline)))

                <p style=\"text-decoration:underline;\">Hello Lisp World!</p>

Great! Everything work like expected!

Brought to you by 40Ants under Creative Commons License