Skip to content
Make CSS code from input HTML
Python
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
README
TODO
makecss.py

README

Create CSS from input HTML code.

From:
<div id="outer">
   <div class="inner">
        <h1>
        </h1>
        <p class="content">
            <span class="date"></span>
        </p>
    </div>
    <div class="inner">
        <h1>
        </h1>
        <p class="content">
            <span class="date"></span>
        </p>
    </div>
</div>

To: (if minified)
div#outer {}
div#outer div.inner {}
div#outer div.inner h1 {}
div#outer div.inner p.content {}
div#outer div.inner p.content span.date {}

of if not minified:

div#outer {
	
}

	div#outer div.inner {

	}

		div#outer div.inner h1 {

		}

		div#outer div.inner p.content {

		}

			div#outer div.inner p.content span.date {

			}

----------------------------------

Usage: add this script as external command or "Custom command" (like in Geany (http://www.geany.com)).
Best served with Zen coding: http://code.google.com/p/zen-coding/ :)

----------------------------------

Config (at the beginning of file):

MINIFIED:
if False the output css formatted by tabs by parent-child relation
if True the output css is minified


RETURNORIGINAL:
if False only the css selectors are returned
if True the input html code returned as well

TABCHAR:
Tab characther for indenting when MINFIED = False

----------------------------------

License: do whatever you want :)
Something went wrong with that request. Please try again.