17

The Ruby LESS gem looks awesome - and I am working on a Python/Pylons web project where it would be highly useful. CSS is, as someone we're all familiar with recently wrote about, clunky in some important ways. So I'd like to make it easier on myself.

Is there an existing Python module or library that provides parallel functionality?

Brighid McDonnell
  • 4,293
  • 4
  • 36
  • 61

4 Answers4

15

I have need for a Python lesscss compiler too, so have started work on one here: http://code.google.com/p/lesscss-python/

Version 0.0.1 has been released, with no support for namespaces/accessors. It is probably riddled with bugs too.

Please feel free to chip in with bug reports/coding or have a look at less-js http://fadeyev.net/2010/06/19/lessjs-will-obsolete-css/.

Metalshark
  • 8,194
  • 7
  • 34
  • 49
  • Looking at the Ruby version it looks like it shouldn't take a whole lot of work to write out the parser/lexer, at least if you're familiar with such things. If I had more use for it, I'd probably try to knock out a CFG. Probably take ~30 minutes to get a rough draft... – Wayne Werner Jul 07 '10 at 19:23
  • However I am not familiar with parsers or lexers (book ordered from Amazon on Bison and Flex). There are a few "issues" with lesscss as it stands (like @media, @font-face's src and "salmon + #111"), so have implemented it using regular expressions, recursive lookups and elbow grease; nearing feature parity right now. Found the current implementation unapproachable so am breaking it up for ease of maintenance - downside is that it'll perform terribly in a comparable benchmark. – Metalshark Jul 08 '10 at 08:43
  • Any chance of you moving to GitHub? I'd like to contribute and I'm lazy. http://blog.hipchat.com/2010/10/15/github-is-making-me-lazy-but-i-like-it/ – a paid nerd Nov 28 '10 at 21:28
  • No problem at all. Development stopped when it had enough features for me to use it. Will post here when done (it is the morning now, will post it in the evening). – Metalshark Nov 29 '10 at 05:10
4

The thing that first comes to mind for me is CleverCSS, a more powerful CSS-ish language with Python and Haskell implementations. I don't know how production-ready this is.

Mike Graham
  • 73,987
  • 14
  • 101
  • 130
  • Hey, that looks promising. Thank you. I hope it's not the only option, though. – Brighid McDonnell May 05 '10 at 16:04
  • @Sean, why do you hope that? Is there something about it you did not like? – Mike Graham May 17 '10 at 19:48
  • 4
    If you choose to go the CleverCSS way, I would recommend using [Jared Forsyth's fork](http://github.com/jabapyth/clevercss), which seems to have fixed quite a few bugs, added missing features like includes, and is actively maintained, while the official CleverCSS was last updated in 2007. – Aram Dulyan Jul 14 '10 at 12:15
4

And another python scss compiler is https://github.com/klen/python-scss

Its used with zeta library (compass alternative) (blueprint, boilerplate, js support, jquery) https://github.com/klen/zeta-library

klen
  • 1,595
  • 12
  • 11
2

There's xCSS for python as well, I've been working on it hopefully giving another alternative to the world. It already implements much of the Saas functionality (variables, mixins, nested rules, extending, color functions, etc.) It's hosted as xCSS for Python at Github

Kronuz
  • 158
  • 2
  • 5