Tailwind Asset For Yii3.
composer require yii-extension/asset-tailwind
Tailwind is a CSS framework that provides all the CSS to customize your application, the widgets by default do not register any Asset so you must register them in your application to be used, since you can simply use the default CSS file layout, or build your own custom CCS.
Three Assets are provided:
- TailwindAsset: Asset file for Tailwind Css Framework include
- TailwindDarkAsset: Asset file for Tailwind Dark Theme Css Framework include
- MinifiedTailwindAsset: Asset file for Minified Tailwind Css Framework include
- MinifiedTailDarkAsset: Asset file for Minified Tailwind Dark Theme Css Framework include
For more information Tailwind.
To use widgets only, register
TailwindAsset::class, which we can do in several ways explained below.
Register asset in view layout or individual view:
By registering the Asset in the
layout/main.php it will be available for all views.
If you need it registered for individual view (such as
register it in that view.
use Yii\Extension\Asset\Tailwind\TailwindAsset; /** * @var Yiisoft\Assets\AssetManager $assetManager * @var Yiisoft\View\WebView $this */ $assetManager->register(TailwindAsset::class); $this->setCssFiles($assetManager->getCssFiles()); $this->setJsFiles($assetManager->getJsFiles());
The package is tested with PHPUnit. To run tests:
The code is statically analyzed with Psalm. To run static analysis:
yii-extension/asset-tailwind for Yii Packages is free software.
It is released under the terms of the BSD License. Please see
LICENSE for more information.
Maintained by Yii Extension.