Last Updated: December 26, 2018
· dommmel

Play Framework 2 with Zurb Foundation and Compass/Sass

Here is how you can use Zurb Foundation together with the Scala web framework Play 2.0.

Add Sass asset handling

add the following plugin to enable Sass asset handling for Play Framework 2.0:

Configure the plugin to use compass and zurb

to tell the plugin to use compass and zurb foundation add the following to build.sbt</code> in your play app's root folder

net.litola.SassPlugin.sassOptions := Seq("--compass","-r", "zurb-foundation")</code>

4 Responses
Add your response

where do you have your compass config.rb file in the play project?

over 1 year ago ·

@brbrown25: I don't have a config.rb file

over 1 year ago ·

I had to change this line to the following:

net.litola.SassPlugin.sassOptions := Seq("--compass", "-r", "compass", "-r", "zurb-foundation")

over 1 year ago ·

I have done as told. But I am having one issue. When I create a sass file it works fine for general sass and compiles properly. But when I want to use Foundation variables in my sass file then it does not have any effect on the css. The IDE does show me suggestions for variables which it says are implicitly imported but use of those variables had no effect on the views.

I tried importing Foundation.scss by @import command as we do in compass. but it gave an error as there was no such file.
I was using Foundation WebJar in my project.

Can you please help !

over 1 year ago ·