Skip to content

oxfmt: Trouble sorting Tailwind CSS classes (using Hono/html + template literals) #18416

@leaysgur

Description

@leaysgur

Discussed in #18399

Originally posted by charnould January 22, 2026
Hello,
First thanks for making oxfmt (and oxlint)!
However I'm struggling to set up TailwindCSS sorting.

Below my config:

{
  "$schema": ".././node_modules/oxfmt/configuration_schema.json",
  "experimentalTailwindcss": {
    "stylesheet": "assets/core/tailwind/style.css",
    "functions": ["html"],
  },
}

and an example of a file I want to apply TailwindCSS sorting:

import { html } from "hono/html";

import { Skill } from "../utils/_schema";

export const view = (skills: Skill[]) => {
  return html`<!doctype html>
    <html lang="fr">
      <head>
        <meta charset="UTF-8" />
      </head>
      <body class="mt-20                          ml-20 w-4xl min-w-4xl bg-stone-50">
        <a href="/a" class="mb-6 block w-fit rounded-full bg-teal-200 px-3 py-1 pr-4 font-medium"
          >← Retour</a
        > .......

When I run oxfmt it does nothing whereas it should at least remove white spaces.
Any idea what I'm missing?
Thanks a lot.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions