Skip to content

Tailwind CSS class sorting in Nuxt UI templates and lack of documentation #5186

@mrkaashee

Description

@mrkaashee

Package

v4.x

Description

❓ What's missing

Nuxt UI is built with Tailwind CSS, but currently:

  • There’s no mention in the Nuxt UI documentation about how to enable or enforce class sorting.
  • Tools like eslint-plugin-tailwindcss or prettier-plugin-tailwindcss are not recommended or documented.

This leads to inconsistency when building or extending UI components using the same design system.


⚠️ Related problem: Prettier vs ESLint conflicts

Trying to use prettier-plugin-tailwindcss just for class sorting often leads to conflicts with existing ESLint rules — especially when ESLint is the primary formatter (as is often the case in Nuxt projects).

Since Nuxt UI doesn't officially support or document a class sorting solution, developers are left guessing how to:

  • Sort Tailwind classes in a consistent way
  • Avoid conflicts between Prettier and ESLint
  • Align their own UI code with Nuxt UI’s internal structure

✅ Suggestions

  1. Document a recommended approach for Tailwind class sorting (via ESLint or Prettier), including tips on avoiding formatting conflicts.

Even a short note would be helpful for teams building on Nuxt UI.

Thanks for all the great work on Nuxt UI — it would be great to see these best practices adopted or supported!

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requestedv4#4488

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions