Ruby LESS gem equivalent in Python

2019-03-12 09:48发布

问题:

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?

回答1:

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/.



回答2:

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.



回答3:

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



回答4:

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