定制 lumen-ui/lumen-tw 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

lumen-ui/lumen-tw

最新稳定版本:v0.3

Composer 安装命令:

composer require lumen-ui/lumen-tw

包简介

Tailwind merge port for Laravel

README 文档

README

GitHub License PHP PhpStan Level Latest Version on Packagist run-tests Total Downloads

A tailwind-merge port for Laravel. Support up to version 4.1 of Tailwind CSS.

LumenTw example

Installation

You can install the package via composer:

composer require lumen-ui/lumen-tw

Usage

// Via global function
tw_merge('px-2 py-1 bg-red hover:bg-dark-red', 'p-3 bg-[#B91C1C]')
// Via service container
app('twMerge')->merge('px-2 py-1 bg-red hover:bg-dark-red', 'p-3 bg-[#B91C1C]');
// Via Facade
use Lumen\TwMerge\Facades\TwMerge;

TwMerge::merge('px-2 py-1 bg-red hover:bg-dark-red', 'p-3 bg-[#B91C1C]');
{{-- Using Blade Directive --}}
<div @twMerge('bg-blue-600 hover:bg-blue-700', 'bg-blue-400')>
    ...   
</div>
{{-- Within blade components using attribute bag macro --}}
<div {{ $attributes->twMerge('text-center') }}>
    ...
</div>

Supported Laravel Versions

  • ☑️ 11.x
  • ☑️ 12.x

Supported Tailwind CSS Versions

This package supports Tailwind CSS versions up to 4.1.

  • ☑️ 4.1.0
  • ☑️ 4.0.0
  • ☑️ 3.x (Legacy)

Reference

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Acknowledgements

  • This package is a port of the tailwind-merge for Laravel.
  • I created this package as a successor to the laravel-tailwind-merge as it was not maintained anymore and as a result, it doesn't support Tailwindcss 4.x and above.
    • Attribute bag macro twMerge, twMergeFor and withoutTwMergeClasses along with @twMerge blade directive are taken from this package.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 388
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 0
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-07-13