(Vegvisir 2, Vegvisir 3)
VV::css()
Import and minify a CSS file.
The syntax is identical to VV::js()
, and VV::embed()
.
VV::css()
imports and minifies a CSS styleheet file and returns it as a string.
pathname
Path to a CSS stylesheet file to import relative from project root.
relative
Path provided to pathname
will be a relative when this parameter is true
(default). Set to false
to make path absolute.
string
A string containing minified CSS. Please note that linebreaks are preserved.
Will return an empty string if the path provided to pathname
is not a valid CSS stylesheet file, or if it failed to import.
Let's take the following CSS stylesheet file and put it into a page.
= Snippet::put("docs/API/PHP/VV/css/example-1-0", Snippet::CSS) ?> = Snippet::put("docs/API/PHP/VV/css/example-1-1", Snippet::PHP) ?>By using VV::css()
inside a style
, we've enabled this stylesheet for that specific page.