I have used LESS.js before. It's easy to use, something like
<link rel="stylesheet/less" href="main.less" type="text/css">
<script src="less.js" type="text/javascript"></script>
I saw SASS.js. How can I use it in a similar way? Parsing a SASS file for use immediately in HTML. It seems like SASS.js is more for use with Node.js?
var sass = require('sass')
sass.render('... string of sass ...')
// => '... string of css ...'
sass.collect('... string of sass ...')
// => { selectors: [...], variables: { ... }, mixins: { ... }}
There is no officially sanctioned JavaScript implementation of sass or scss. There are a couple of implementations in progress that I've seen, but none that I can recommend using at this time.
However, please a few points:
So while it's a little more setup to get started, we (the sass core team) think that server side compilation is the best long term approach. Similarly, the less developers prefer server side compilation for production stylesheets.