website/public/docs/v3.1.5/Reference/PHP/VV/css.php

52 lines
No EOL
1.9 KiB
PHP

<?= VV::include("public/docs/v3.1.5/Reference/layout") ?>
<main>
<section>
<h1>VV::css()</h1>
<p>Include a CSS file into a page which will be automatically minified and inlined.</p>
</section>
<section>
<?= VV::include("snippets/HTMLCodeDemoElement/HTMLCodeDemoElement?id=docs/v3.1.5/PHP/VV/css/description") ?>
</section>
<section>
<h1>Parameters</h1>
</section>
<section class="md param">
<h3><code class="mtk6">string</code></h3>
<h2><code class="mtk10">$pathname</code></h2>
<p>Path to a CSS stylehseet file.</p>
<p>Appending ".css" to the filename is optional. If omitted, the extension is infered.</p>
</section>
<section class="md param">
<h3><code class="mtk6">bool</code></h3>
<h2><code class="mtk10">$relative</code></h2>
<p>Flag which when set to:</p>
<ol>
<li class="default">
<code class="mtk6">true</code>
<p>Will make <code class="mtk10">$pathname</code> look for a CSS file relative to <a href="/docs/v3.1.5/Reference/Env#root_path"><code>root_path</code></a>.</p>
</li>
<li>
<code class="mtk6">false</code>
<p>Will make <code class="mtk10">$pathname</code> look for a CSS file relative to the root of the whole filesystem.</p>
</li>
</ol>
</section>
<section>
<h1>Return value</h1>
</section>
<section>
<h3><code class="mtk6">string</code></h3>
<p>Returns a minified version of the included stylesheet as a string. If a stylesheet can not be found at <code class="mtk10">$pathname</code>, an empty string is returned.</p>
</section>
<hr>
<section>
<h1>Examples</h1>
</section>
<section>
<h2>Importing a stylesheet</h2>
<p>In this example we're importing a stylesheet from <code>/public/assets/css/style.css</code> relative from <a href="/docs/v3.1.5/Reference/Env#root_path"><code>root_path</code></a>.</p>
</section>
<section>
<?= VV::include("snippets/HTMLCodeDemoElement/HTMLCodeDemoElement?id=docs/v3.1.5/PHP/VV/css/example_import") ?>
</section>
</main>