#!/bin/sh

elmts=`find png -maxdepth 1 -mindepth 1 -type d | sed s/'^png\/'//`

for e in $elmts; do
    echo -n "making '$e': " >&2
    ls png/$e | egrep -e '.png$' | while read f; do
	    F=`echo $f | sed s/.png// | tr a-z A-Z`;
        echo -n "$F " >&2
	    echo "span[class=\"$e$F\"] {";
	    echo "    background-image: url(\"$e/$f\");";
        #	echo "    content: \"<img src=\\\"$f\\\" />\";";
	    echo "}";
        mogrify -trim ./png/$e/$f
    done >| png/$e.css

    echo "done: png/$e.css" >&2
done
