0.0.2 • Published 13 years ago

css-sourcery v0.0.2

Weekly downloads
9
License
-
Repository
github
Last release
13 years ago

CSS SOURCERY

A pure-Javascript CSS templating library, meant for use with node. Features optional semicolons, nested rules, functions, optional minification, partials and partial caching. require in code from the rest of your app where you need it, and feel free to drop down to native CSS as you see fit.

LET'S MAKE MAGIC

var src = require('css-sourcery');

src.compile([
	src.rule('.sourcery', [
		src.rule('ul', [
			'list-style-type:none',
			function(params) {
				if(params.dumbledore)
					return 'color:yellow';
				return 'color:black';
			}
		]),
		'color: #999',
		'font-family: Helvetica, Arial, sans-serif'
	]),
	"h2 { font-size:40px; color: #666; }"
], { dumbledore: true });

ABRACA-WHAT?

.sourcery ul {
	list-style-type:none;
	color:yellow;
}
.sourcery {
	color:#999;
	font-family: Helvetica, Arial, sans-serif;
}
h2 {
	font-size:40px;
	color:#666;
}

Shazam. CSS wizardry.