On Tue, Mar 12, 2013 at 5:32 PM, David Hess <[email protected]> wrote: > However, why would those tools be better than just using Jinja2 to > accomplish the same thing by passing CSS templates through it? > > Does anybody have opinions on the pros and cons of using Jinja2 this way? Am > I missing something obvious?
Jinja2 is a general purpose templating language for text, so it doesn't understand the CSS language or have any special features for working with CSS. For example, look at the nesting / mixin / inheritance features of SASS. You could get something similar to work using jinja2 blocks, but you'd have to write some custom code yourself to output the proper CSS. If the preprocessor is implemented correctly, it guarantees that the output is valid CSS. If you just want to do something simple like using variables so you don't have to repeat hex codes for colors everywhere, then I think jinja2 would work fine. I've done that a few times and jinja2 works great for that type of thing! But if you have very complicated CSS then using the advanced features of a preprocessor like SASS or LESS would probably give you more benefit. Look at how bootstrap uses LESS for example: https://github.com/twitter/bootstrap/tree/master/less -Steve -- You received this message because you are subscribed to the Google Groups "pocoo-libs" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/pocoo-libs?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
