aptinio

Canonicalizes Tailwind CSS utility classes in HEEx templates via mix format

18
0
100% credibility
Found Mar 29, 2026 at 18 stars -- GitGems finds repos before they trend. Get early access to the next one.
Sign Up Free
AI Analysis
Elixir
AI Summary

An Elixir package that automatically sorts, deduplicates, and standardizes Tailwind CSS classes in Phoenix LiveView HEEx templates during mix format.

How It Works

1
😩 Jumbled style lists

You're building web pages and your lists of visual style instructions get messy, duplicated, and hard to read.

2
🔍 Discover the tidy helper

You learn about a handy add-on that automatically organizes those style lists whenever you clean up your code.

3
📦 Add it to your project

You simply include this helper in your project's collection of tools.

4
⚙️ Link it to your cleanup routine

You update your code-cleaning settings so it knows to straighten out the style instructions too.

5
🧹 Clean up your pages

Next time you tidy your code, the helper sorts, simplifies, and removes extras from the style lists automatically.

🎉 Neat styles every time

Your web page code now stays perfectly organized and professional-looking with zero extra effort.

Sign up to see the full architecture

4 more

Sign Up Free

Star Growth

See how this repo grew from 18 to 18 stars Sign Up Free
Repurpose This Repo

Repurpose is a Pro feature

Generate ready-to-use prompts for X threads, LinkedIn posts, blog posts, YouTube scripts, and more -- with full repo context baked in.

Unlock Repurpose
AI-Generated Review

What is canonical_tailwind?

This Elixir tool canonicalizes Tailwind CSS utility classes in HEEx templates via mix format, sorting them, normalizing to canonical forms like tailwind canonical classes, and collapsing duplicates. It solves the mess of scattered, repeated classes in Phoenix LiveView class attributes—think turning "mr-4 custom-btn flex ml-[1rem] flex" into "custom-btn mx-4 flex" automatically on save. Powered by the tailwindcss CLI's canonicalize command, it preserves unknown classes and works in strings or Elixir expressions.

Why is it gaining traction?

Unlike basic sorters, it taps the official Tailwind engine (same as the Prettier plugin for tailwind css suggest canonical classes), ensuring accurate normalization even with custom themes. Seamless setup in .formatter.exs with attribute_formatters hooks into mix format and LSP editors for near-instant feedback after startup, plus config for pool size and multi-profile Tailwind setups. Developers notice cleaner diffs and less mental load on utility class order.

Who should use this?

Phoenix LiveView devs building HEEx templates with Tailwind who run mix format regularly. Ideal for teams enforcing consistent tailwind suggest canonical classes in class attributes, especially on larger codebases where duplicates creep in. Skip if you're not on Elixir 1.18+ or tailwindcss CLI 4.2.2+.

Verdict

Try it if Tailwind in HEEx is your jam—solid docs and easy dev-only dep make it low-risk, despite 18 stars and 1.0% credibility signaling early maturity (v0.1.3). Pairs perfectly with Phoenix workflows but watch for CLI startup lag on first format.

(198 words)

Sign up to read the full AI review Sign Up Free

Similar repos coming soon.