Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Escape `@` in yesod templates

I'm trying to use @font-face selector in cassius template with no luck.

Cassius uses @ for interpolation, is there any way to escape it?

I've tried @@ and \@, none of them works.

Following template

@font-face
      font-family: 'Monsieur La Doulaise'
      src: url('http://fonts.googleapis.com/css?family=Monsieur+La+Doulaise')

Results in

src: url('http://fonts.googleapis.com/css?family=Monsieur+La+Doulaise');}
like image 487
lambdas Avatar asked Nov 12 '22 20:11

lambdas


1 Answers

This is pretty ugly, but may work:

... defaultLayout $ do let atSym = "@" [cassius|#{atSym}font-face ... |] ...

in other words, bind a string to the value of "@" and interpolate that in the cassius file. I can't check the syntax now but it may work.

like image 123
max Avatar answered Nov 15 '22 08:11

max