Skip to content

Instantly share code, notes, and snippets.

@fancellu
Last active February 25, 2021 13:46
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fancellu/2acb98da272da0dbd7b8235ecf39d125 to your computer and use it in GitHub Desktop.
Save fancellu/2acb98da272da0dbd7b8235ecf39d125 to your computer and use it in GitHub Desktop.
Tip to have CSS with Play Twirl, if SASS isn't powerful enough for you...
def css = Action {
val css: TxtFormat.Appendable =views.txt.css()
Ok(css).as("text/css")
}
inside HTML
<link rel="stylesheet" href="@routes.HomeController.css()"/>
inside css.scala.txt, the css. with @ escaped to @@ (twirl likes @)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment