docs/prompts/tailwindcss.md
Use this prompt when asking AI assistants to help migrate CSS components to Tailwind:
I'm migrating a CSS component to Tailwind CSS. Please help me convert the existing styles following these strict guidelines:
@apply directives - All Tailwind classes must be applied directly in the markup, not through CSS files[#hex], [10px], etc. Use design system tokens. If you must use arbitrary values, explain why they're necessarysm:, md:, lg: prefixes only where values actually changehidden lg:flex lg:mx-2 lg:items-center lg:justify-betweenhidden lg:flex mx-2 items-center justify-betweenPrefer using our classNames utility over cx, twMerge, or ternary operators
// Good
import { classNames } from "$app/utils/classNames";
classNames(
"base-class",
condition && "conditional-class",
) // Avoid
`base-class ${condition ? "conditional-class" : ""}`;
import cx from "classnames";
cx("base-class", condition && "conditional-class");
import twMerge from "tailwind-merge";
twMerge("base-class", condition && "conditional-class");
!importantmt-2!, flex!, etc.)prose plugin for content-heavy areas with paragraphs, lists, and rich textWhen providing the migrated code:
prose plugin might be beneficialCopy the prompt above and paste it into your AI assistant when working on Tailwind migrations. Include the component code you're migrating after the prompt.