Cssutils is a project mainly written in JavaScript, it's free.
Stand-alone, CommonJS compatible CSS library
Stand-alone, CommonJS compatible library to aid CSS operations.
From NPM:
$ npm install cssutils
Or, from Github:
$ curl https://github.com/azer/cssutils/raw/master/lib/cssutils.js -o cssutils.js
On a CommonJS compliant environment (JSBuild, Browserify, RequireJS etc.)
> var cssutils = require('cssutils');
> cssutils.prop(element, 'border-bottom-width');
2px
> cssutils.prop(element, 'border-bottom-width', '5px');
On a classic browser environment:
<script src="cssutils.js"></script>
> cssutils.toggleClass(element, 'foobar');
status: under development
todo: