Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

access assets within css play framework

How do I refer to assets within a CSS file?

I am using Play Framework 2.1.3 (Scala).

@font-face
{
    font-family: RockSalt;
    src: url('...something.../assets/fonts/MyFont.ttf');
    format('truetype');
}
like image 979
latj Avatar asked Oct 20 '13 23:10

latj


1 Answers

There's nothing magic about this topic in Play , just use relative paths to your font files in your CSS file. ie. if you have css and fonts folders on the same level it will be:

src: url('../fonts/MyFont.ttf');

if you are using default route for assets it can be also path that is relative to app's root:

src: url('/assets/fonts/MyFont.ttf');
like image 196
biesior Avatar answered Oct 21 '22 09:10

biesior