DEV Community

Cover image for I Spent an Hour Fixing Tailwind Classes GitHub Copilot Created in 10 Seconds
Avery
Avery

Posted on

I Spent an Hour Fixing Tailwind Classes GitHub Copilot Created in 10 Seconds

I still remember the moment clearly.

I asked GitHub Copilot to build a simple React component. Ten seconds later it was done. Clean, functional, no errors.

Then I looked at the Tailwind classes.

The same combination of fifteen utilities scattered across four different places in my React project. Inline on every element. No abstraction. No pattern. Just raw utility chains copied pasted into existence.

It looked fine. Until I had to change the design.

Then I spent an hour hunting through files, fixing the same styling in place after place after place.

Ten seconds to create. One hour to fix.


The problem is not Tailwind

The problem is not Tailwind. It is that Copilot has no styling rules.

Tailwind is fast by design. You write utility classes inline and move on.

That works when you are the only one writing the code. When you remember what you wrote. When the project is small enough to hold in your head.

GitHub Copilot does not remember anything.

Every prompt is a fresh start. No memory of what you wrote last session. No awareness of the patterns you have established. No idea that you already used those fifteen classes somewhere else.

So it inlines everything. Every time. Confidently.

And your React project slowly turns into a styling mess that nobody including you can maintain.


What changed when I gave Copilot one rule

I added one constraint to my Copilot sessions.

Never repeat the same Tailwind utility combination. If a pattern appears more than once, extract it.

That is it.

The inline chaos stopped. Repeated patterns got extracted automatically. When the design changed I changed it in one place.

One rule. One constraint. Completely different output.


The deeper problem

Tailwind chaos is just one symptom.

Your AI coding tool has no styling rules, no architecture rules, no component rules unless you give them explicitly.

Every area without constraints is an area where GitHub Copilot improvises. And improvised Tailwind in a React project compounds fast.

That is what makes AI coding in React predictable. Not a better prompt, but explicit rules your AI has to follow.


Want the exact rules I use?

I packaged my first three React AI rules as a free PDF including the exact prompt blocks ready to paste into GitHub Copilot or Cursor before your next session.

👉 Get My First 3 React AI Rules — free

And if you want the full system, rules across architecture, typing, state, accessibility, and more:

👉 Avery Code — React AI Engineering System

Top comments (0)