tobya / tailwind-trumpet
一个用于吹响或暴露代码中设置的 Tailwind css 类的包。
v0.4
2024-05-29 19:30 UTC
Requires
- php: ^8.0
- illuminate/contracts: ^10.0||^11.0
- spatie/laravel-package-tools: ^1.16
Requires (Dev)
- larastan/larastan: ^2.9
- laravel/pint: ^1.14
- nunomaduro/collision: ^8.1.1||^7.10.0
- orchestra/testbench: ^9.0.0||^8.22.0
- pestphp/pest: ^2.34
- pestphp/pest-plugin-arch: ^2.7
- pestphp/pest-plugin-laravel: ^2.3
- phpstan/extension-installer: ^1.3
- phpstan/phpstan-deprecation-rules: ^1.1
- phpstan/phpstan-phpunit: ^1.3
- spatie/laravel-ray: ^1.35
README
Tailwind Trumpet,吹响(!)隐藏的 Tailwind 类。将这些在 PHP 对象中使用的隐藏 CSS 类暴露出来,以便它们始终在你的 blade 中可用。
有时你可能发现你有一组颜色或其他样式,你在 PHP 代码中分配,例如,你有一张特定类型的课程列表,你希望每种类型在前端显示时都具有相同的 Tailwind 颜色,但由于 Tailwind 编译掉未使用的类且不扫描 PHP 代码,你需要通常将此代码移动到前端。
Tailwind Trumpet 通过允许你注册 PHP 代码使用的任何 Tailwind 类来解决此问题,然后这些类被发布到你的 views
目录,以便 Tailwind 构建过程可以找到它们。
安装
您可以通过 composer 安装此包。
composer require tobya/tailwind-trumpet
您可以使用以下命令发布配置文件:
php artisan vendor:publish --tag="tailwind-trumpet-config"
这将输出以下文件。
config\trumpet.php
| A list of classes here that will return a list of classes that need to be exposed.
| classes must have a function trumpetTailwindClasses() that returns a String or array of Strings
return [ \App\Services\CourseTypeLookupService::class, ];
使用方法
> php artisan trumpet:expose
测试
composer test
变更日志
请参阅变更日志以获取有关最近更改的更多信息。
贡献
请参阅贡献指南以获取详细信息。
安全漏洞
请查阅我们的安全策略了解如何报告安全漏洞。
致谢
许可证
MIT 许可证(MIT)。请参阅许可证文件以获取更多信息。