定制 yieldstudio/tailwind-merge-php 二次开发

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

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

yieldstudio/tailwind-merge-php

Composer 安装命令:

composer require yieldstudio/tailwind-merge-php

包简介

Merge Tailwind CSS classes without style conflicts

README 文档

README

Social Card of Tailwind Merge PHP

Efficiently merge Tailwind CSS classes in PHP without style conflicts

Latest Version GitHub Workflow Status Total Downloads

This package allows you to merge multiple Tailwind CSS classes and automatically resolves conflicts between them without headaches.

tailwind-merge-php is a PHP port of the excellent tailwind-merge created by dcastil.

  • Supports Tailwind v3.0 up to v3.3
  • First-class support for Laravel

Installation

composer require yieldstudio/tailwind-merge-php

Usage

use YieldStudio\TailwindMerge\TailwindMerge;
use YieldStudio\TailwindMerge\TailwindMergeConfig;

// Singleton
$twMerge = TailwindMerge::instance();
$twMerge->merge('w-8 h-8 rounded-full rounded-lg'); // w-8 h-8 rounded-lg

// Custom instance
$twMerge = new TailwindMerge(TailwindMergeConfig::default()); // Config is optional
$twMerge->merge('w-8 h-8 rounded-full rounded-lg'); // w-8 h-8 rounded-lg

Laravel Support

You can publish the configuration file with:

php artisan vendor:publish --provider="YieldStudio\TailwindMerge\Laravel\TailwindMergeServiceProvider"

Using the tw helper

tw('w-8 h-8 rounded-full rounded-lg'); // w-8 h-8 rounded-lg

Using Blade directive

<div @tw('w-8 h-8 rounded-full rounded-lg')></div>

// will be
<div class="w-8 h-8 rounded-lg"></div>

Using Blade components

// avatar.blade.php
<div {{ $attributes->tw('w-8 h-8 rounded-full') }}></div>

// header.blade.php
<x-avatar class="rounded-lg" />

// will be
<div class="w-8 h-8 rounded-lg"></div>

Configuration & plugins

✍️ Complete documentation is being written

Unit tests

To run the tests, just run composer install and composer test.

Changelog

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

Contributing

Please see CONTRIBUTING for details.

Security

If you've found a bug regarding security please mail contact@yieldstudio.fr instead of using the issue tracker.

Credits

License

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

统计信息

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

GitHub 信息

  • Stars: 49
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-06-10

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固