PHPackages                             iq2i/tailwind-cs-fixer - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. iq2i/tailwind-cs-fixer

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

iq2i/tailwind-cs-fixer
======================

A tool to automatically sort Tailwind CSS classes in HTML and Twig files

1250PHPCI failing

Since Mar 16Pushed 3mo agoCompare

[ Source](https://github.com/IQ2i/tailwind-cs-fixer)[ Packagist](https://packagist.org/packages/iq2i/tailwind-cs-fixer)[ RSS](/packages/iq2i-tailwind-cs-fixer/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

Tailwind CS Fixer
=================

[](#tailwind-cs-fixer)

A PHP tool to automatically sort Tailwind CSS classes in your HTML and Twig files, without any JavaScript dependencies.

Features
--------

[](#features)

- ✅ Sorts Tailwind classes according to the official order (like `prettier-plugin-tailwindcss`)
- ✅ HTML and Twig support
- ✅ Handles variants (hover:, focus:, md:, lg:, etc.)
- ✅ Supports arbitrary values (`w-[42px]`)
- ✅ Preserves dynamic Twig expressions
- ✅ Dry-run mode to preview changes
- ✅ Diff display
- ✅ No Node.js dependency

Installation
------------

[](#installation)

```
composer require --dev iq2i/tailwind-cs-fixer
```

Usage
-----

[](#usage)

### Basic command

[](#basic-command)

```
# Fix all files in the current directory
vendor/bin/tailwind-cs-fixer

# Fix a specific directory
vendor/bin/tailwind-cs-fixer templates/

# Fix a specific file
vendor/bin/tailwind-cs-fixer templates/base.html.twig
```

### Options

[](#options)

```
# Dry-run mode (preview without modification)
vendor/bin/tailwind-cs-fixer --dry-run

# Show differences
vendor/bin/tailwind-cs-fixer --diff

# Specify file extensions
vendor/bin/tailwind-cs-fixer --extensions=html,twig,php

# Combine options
vendor/bin/tailwind-cs-fixer templates/ --dry-run --diff
```

Current limitations
-------------------

[](#current-limitations)

- Does not sort classes in complex Twig conditions
- Order is not configurable (follows official Tailwind order)

Issues and feature requests
---------------------------

[](#issues-and-feature-requests)

Please report issues and request features at .

License
-------

[](#license)

This bundle is under the MIT license. For the whole copyright, see the [LICENSE](LICENSE) file distributed with this source code.

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance53

Moderate activity, may be stable

Popularity17

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity12

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/911eee5cdea5a7a363c88e69d05e828b21e544ebdf573df9f887e72b2c6f0eb8?d=identicon)[LoicSapone](/maintainers/LoicSapone)

---

Top Contributors

[![loicsapone](https://avatars.githubusercontent.com/u/4466694?v=4)](https://github.com/loicsapone "loicsapone (12 commits)")

---

Tags

phptailwindtailwindcss

### Embed Badge

![Health badge](/badges/iq2i-tailwind-cs-fixer/health.svg)

```
[![Health](https://phpackages.com/badges/iq2i-tailwind-cs-fixer/health.svg)](https://phpackages.com/packages/iq2i-tailwind-cs-fixer)
```

###  Alternatives

[drpshtiwan/livewire-async-select

A powerful async select component for Laravel Livewire with Alpine.js - a modern alternative to Select2

1116.8k](/packages/drpshtiwan-livewire-async-select)[generationtux/healthz

Health checks for PHP apps.

2640.8k](/packages/generationtux-healthz)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
