A code-as-data take on conjuring up CSS, meant for use with NodeJS.
JavaScript CoffeeScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
test
.gitignore
Cakefile
GNU General Public License.txt
LICENSE.txt
README.md
index.coffee
index.js
package.json

README.md

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.