> To do this, you'd have to let the p and a methods to accept blocks.
They do—the problem is that blocks are used to express nesting. One could probably rewrite the interpreter to do what you suggest without too much of a headache.
> Ruby has some interesting possibilities in this space. (Then again, so does Lisp.)
If I were to write it again, I would be very tempted to use Lisp instead. The syntax wouldn't be as close to CSS as Ruby, but it would make it a lot easier and more natural to perform transformations on trees of rules.
Ultimately a decision whether to use a library like this is dictated by two factors: will the person writing the frontend code be happy using (and, presumably, debugging and patching) a library of this sort, and is the gain in expressivity sufficient to overcome the need to write it in the first place and then familiarise the users with it? As discussion elsewhere on this thread indicates, I suspect that most of the time the answer will be 'No'.
There are two reasons for this. Firstly, even if the sort of frontend developers who write lots of CSS are, in general, at least some sort of programmer, it's rare that they will be the sort to quickly become comfortable writing in Lisp. Secondly, while the gains in expressivity and maintainability when one can factor out repetition and introduce variables are important, presentation-layer code does not lend itself to the kind of reduction in size (by introducing abstractions) that application-level code is. It's hard to write very general CSS; one tends to quickly become bogged down in special cases.