useclassy/laravel
最新稳定版本:v1.0.0
Composer 安装命令:
composer require useclassy/laravel
包简介
Laravel integration for UseClassy - Transform class:modifier syntax in Blade templates
README 文档
README
Laravel integration for UseClassy that transforms class:modifier="value" syntax in Blade templates.
Installation
composer require useclassy/laravel
The service provider will be automatically registered via Laravel's package auto-discovery.
Usage
Use the class:modifier syntax in your Blade templates:
<h1 class="text-xl" class:lg="text-3xl" class:hover="text-blue-600"> Responsive heading that changes on large screens and hover </h1> <div class:dark="bg-gray-800 text-white" class:lg="p-6"> Dark mode and responsive padding </div>
The package will automatically transform these during Blade compilation:
class:lg="text-3xl"becomeslg:text-3xlclass:hover="text-blue-600"becomeshover:text-blue-600class:dark="bg-gray-800 text-white"becomesdark:bg-gray-800 dark:text-white
These transformed classes are merged with any existing class attributes.
How it Works
This package hooks into Laravel's Blade compiler to transform the UseClassy syntax before the template is rendered. It works seamlessly with:
- Hot module reloading
- Blade caching
- All Laravel versions 10+
Requirements
- PHP ^8.1
- Laravel ^10.0|^11.0|^12.0
License
MIT
统计信息
- 总下载量: 11
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-07-26