I'm having some problems using CSS in Play Framework 2.0.3, and was wondering if anyone could spot the mistakes I am making.
I have a view called siteview.scala.html, defined as:
@(name: String, records: List[Record])
@import helper._
@main(name) {
<html>
<head>
<link rel="stylesheet" type="text/css" href="@routes.Assets.at("stylesheets/main.css")">
</head>
<h1>@name</h1>
<ul>
...
</ul>
</html>
}
I have a CSS file defined as main.less
in app/assets/stylesheets
which looks like:
h1 {color:#F6F9ED;}
@font-face {
font-family: Gentium;
src: url(fonts/GenBasR.ttf);
}
font-family: Gentium, Arial, Georgia;
Apologies for the terrible style, I kept changing to try and make it do something! The route to the assets has been left as the default.
Play definitely compiles the CSS; if there is a syntax error, it is spotted. However, the CSS is just not being loaded into the HTML.
I tried copying the CSS file right into the public folder, but that gave me a duplicate file error from the compiler, which probably indicates the file is being put in the right place.
How do I make the HTML display with styling? I have a feeling I am missing something quite obvious, but am quite new to web development so I'm quite out of ideas.