Cannot call function css


#1

Hi, I put simple mustache functions in my master template like so:
{{ css(‘css/layout’) }}
{{ css(‘http://fonts.googleapis.com/css?family=Lato:300,400,400italic,600,700|Raleway:300,400,500,600,700|Crete+Round:400italic’) }}

But when rendering my app, I get an error 500 stating:
Cannot call function css from master.edge view

What did I do wrong?
Boudewijn


#2

Hey @boudewijnt! :wave:

The name of this function is style not css.


#3

Thanks, this helped! I guess that changed in since early this year?


#4

According to official docs, this is the way to link a css archive inside a view

{{ style('element') }}

And the name is linked to a relative arhive from the public directory

Or this way is also valid

{{ style('path/styles.css') }}

More details right here: https://adonisjs.com/docs/4.1/views