byjam / craft-tailwind-merge
Twig的Tailwind合并工具
0.0.3
2024-04-09 16:18 UTC
Requires
- php: >=8.2.0
- craftcms/cms: ^5.0
- gehrisandro/tailwind-merge-php: ^0.0.1
This package is not auto-updated.
Last update: 2024-09-10 18:18:48 UTC
README
Twig的Tailwind合并工具。这是一个围绕
用法
<a href="" class="{{ twMerge('rounded-full px-2 font-semibold border-4', 'font-bold border-6') }}">
</a>
将返回
<a href="" class="rounded-full px-2 font-bold border-6"></a>
有关完整用法,请参阅https://github.com/gehrisandro/tailwind-merge-php,它是https://github.com/dcastil/tailwind-merge的移植版。所有荣誉归功于这两位,这只是一个包装器。
要求
此插件需要Craft CMS 4.4.0或更高版本,以及PHP 8.1或更高版本。
安装
您可以从插件商店或使用Composer安装此插件。
从插件商店
转到项目的控制面板中的插件商店,搜索“TailwindMerge”,然后按“安装”。
使用Composer
打开您的终端并运行以下命令
# go to the project directory cd /path/to/my-project.test # tell Composer to load the plugin composer require byjam/craft-tailwind-merge # tell Craft to install the plugin ./craft plugin/install tailwind-merge