Is it possible to integrate Sass and Play Framework 2.3, so that Sass gets compiled to CSS? If so, how should I go about it? I\'ve tried the play-sass plugin, but it doesn\'t bu
As you probably know, Play has migrated to using sbt-web as the model for its asset pipeline, instead of the old system. It's much more flexible than the old system. Unfortunately, since it's so new, it also lacks whole lot of existing packages. You'll either have to write sbt-sass yourself or wait till someone else does. I'm in the same boat for migrating my project to Play 2.3.
From the Play Webinar on Tuesday, Christopher Hunt from Typesafe did a fully fledged example sbt-web plugin for stylus, and linked to the source here. Most of the logic is written Node-style in a JS script, with modules pulled from WebJars instead of NPM.
The two parts of the process that would have to be modified are in the JS file that the part for invoking Sass instead of Stylus and the part for parsing errors to pass back to Play. The latter is just editing the parseError
function. The former you could either do by directly plugging in the code to invoke Sass or by adapting an existing Sass wrapper to WebJar form, as they did with Stylus, and using it in the same way. There are a couple on npm that might do the trick.
Edit I've been using the ShaggyYeti sbt-sass
package for months now, to great effect. See the other answer.