1. Go to this page and download the library: Download webx-ui/themes library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
webx-ui / themes example snippets
use WebxUi\Themes\ThemeIcons;
app(ThemeIcons::class)->names(); // every icon of the chain
app(ThemeIcons::class)->has('phone');
theme_token('color-accent'); // '#0e6b5c'
theme_token('color-danger', '#e11d48'); // the default when the chain gives no value
theme_token('font-heading'); // 'Inter, system-ui, …' — a reference to another token resolved
use WebxUi\Themes\ThemeChain;
$chain = app(ThemeChain::class);
$chain->layers; // list<ThemeManifest>, top first
$chain->top(); // the theme the site configured, or null
$chain->viewPaths(); // every layer's views/ directory
$chain->
use WebxUi\Themes\Checks\CssCheck;
use WebxUi\Themes\Vocabulary;
foreach (CssCheck::check($css, Vocabulary::base()) as $finding) {
$finding->line; // where
$finding->problem; // CssProblem: literal colour or font, unknown token, fallback, @media by width
$finding->message(); // what and why, in a line
}
use WebxUi\Themes\Testing\ModuleThemeContract;
final class ThemeContractTest extends \PHPUnit\Framework\TestCase
{
use ModuleThemeContract;
protected function modulePath(): string { return dirname(__DIR__); }
}
use WebxUi\Themes\Testing\ThemeContract;
final class ThemeTest extends TestCase
{
use ThemeContract;
protected function themePath(): string { return dirname(__DIR__); }
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.