WordPress with Haml/Sass

Having used Haml and Sass for a few Rails side projects, I’ve found that they speed up my frontend development tremendously. However, I haven’t found a Rails blogging platform that’s as robust or familiar to clients as WordPress, so that’s still generally my go-to for projects that require a light website with basic CMS / blogging functionality. (I’ve looked into Radiant, Mephisto, etc, and while I certainly appreciate suggestions of Rails blog engines, that’s not really the question I’m looking to answer here.)

I’d really like to be able to use Haml and Sass in the context of a WordPress site, and while I’m aware of the existence of various PHP implementations, most seem inactive or buggy. Has anyone here had success using Haml and Sass with WordPress sites? I’m asking this both in the context of WordPress template files (the .php files that power a WordPress theme) and in the HTML editing mode of the WordPress editor, though the latter is far less important.

Read More

Note: I’m aware that I can just install the appropriate ruby gems and compile my own HTML/CSS from the Haml/Sass source; what I’m looking for is something more along the lines of the functionality I’m used to in Rails, where the compiled HTML/CSS is autogenerated on a per-request basis (caching behaviour would also be nice, but is certainly not required).

Thanks in advance!

Related posts

Leave a Reply

9 comments

  1. I’m in the same boat with respect to the sites with a low demand for customization. I’m so used to Haml and Sass that going back to HTML and CSS seems painful. PHamlP has gotten some good reviews, especially because it supports Sass: (http://code.google.com/p/phamlp/). Still, there’s no substitute for the real thing.

    If it were my project, I’d consider Compass and just do a compass update when I made changes. Sass is too good to pass up. Haml is your daily bread and butter, but Sass can really help you make pages sing. It suggests stylesheet refactorings you might never have thought of otherwise.

  2. I realise this is an older thread, but I landed here so others might too. There are a number of gulp and grunt plugins that will do this, however if you’re on OSX, CodeKit is super convenient.

    And the folks over on this SO thread, offer suggestions on how to compile haml in php files.