BLOG
AI Can Write CSS for You. Here's Why You Still Need to See What It Does
The question changed. It used to be "how do I write this CSS?" Now it is "how do I know whether this CSS is right?" - and that question has no answer in text.
What actually happened to the problem
Ask an assistant in 2026 to round your Squarespace buttons and add a subtle shadow, and you will get working CSS in about four seconds. Something like this:
.sqs-block-button-element {
border-radius: 20px !important;
box-shadow: 0 8px 30px rgba(0, 0, 0, .15);
padding: 14px 32px !important;
transition: all .2s ease;
}
The syntax is fine. The properties are the right ones. And there are still three things wrong with it that no amount of language fluency reveals:
-
You cannot tell what it looks like.
0 8px 30px rgba(0,0,0,.15)is a specification, not an image. Whether that shadow reads as "subtle" or "dated" depends on your background colour, your card size and your taste. -
You cannot tell where it applies. The selector
.sqs-block-button-elementis a plausible guess at Squarespace's markup. It may match every button on every page, or nothing at all on your particular version. The assistant does not have your site. - You cannot tell what changed after you ask for a revision. Ask for "slightly smaller corners" and you get a fresh block of CSS. Which of the five lines moved? You are being asked to diff code you did not write, by eye.
AI can generate code. Visual tools help you validate it. Generation and validation are different jobs, and only one of them has been automated.
Why "correct CSS" is not the same as "the CSS I wanted"
A block of CSS can be completely valid and still be wrong for your site in three specific ways. All three are invisible in the code and obvious on screen.
Scope: the rule reaches further than you meant
Generated CSS tends to use the broadest plausible selector, because that is the safest guess for a model that cannot see your page. On your site it may restyle the navigation buttons, the newsletter signup and the checkout button along with the one you wanted. The fix is not a better prompt - it is looking at which elements changed.
Values: the number is technically fine and visually wrong
30px of blur is reasonable on a large hero card and absurd on a small pricing tile.
20px of corner radius is friendly on a button and sloppy on a full-width banner. These
are judgements about your specific layout, and they can only be made by looking.
Context: it fights the theme instead of extending it
Squarespace themes ship with their own rules. Generated CSS that does not know about them either
loses the fight silently or wins it with !important - and !important is
how a site ends up with CSS nobody dares edit six months later.
Expectation
Soft corners, a whisper of shadow.
Book a visitWhat arrived
Pill shape, heavy drop shadow.
Book a visitBoth satisfy the prompt. Only one was meant. You cannot tell which from the code.
The workflow that actually works now
The useful sequence is not "ask again until it looks right" - that loop never converges, because you are describing visual differences in words and receiving whole new blocks of code. It is:
Describe → Generate → Visualize → Adjust → Copy
- Describe what you want in plain language, to whatever assistant you use. This part genuinely is solved - take the draft.
- Generate - accept the first draft and stop prompting. Asking for five revisions costs more time than adjusting one value yourself.
- Visualize - see it rendered on your own markup before it touches your site. This is the step that was missing. The CSS Code Editor does it: paste a section, see it rendered, adjust and copy back.
- Adjust the value that is wrong - the shadow is too strong, the radius too round - by looking at the result rather than by writing another prompt.
- Copy only the properties you actually changed, and check where they apply before they go live.
The middle step is the point. AI produces the first draft efficiently; the finishing work is judgement, and judgement needs something to look at.
What a visual check catches that reading does not
- A shadow that looks heavy against your actual background colour
- A radius that clashes with the image corners inside the same card
- Padding that makes a button look tall rather than substantial
- A rule that also restyled elements on a page you were not looking at
- A font size that fits on desktop and wraps badly on a phone
- Two rules fighting each other, where the visible result is neither
None of these are syntax errors. Every one of them survives a careful read of the code and shows up in half a second on screen.
Being honest about the limits
Seeing the CSS does not make it safe by itself. Two cautions worth keeping:
- Rendering a section is not the same as testing your site. A preview shows what the values do to that section. It does not prove which elements the rule reaches on your live pages - you still need to check other pages afterwards.
- Generated CSS still needs reading, briefly. Look at the selector and ask where it applies. If it is broader than you intended, narrow it. This is the single highest-value habit, and it is why the four-step routine in A Safer Workflow for Editing Squarespace CSS insists on reading the selector before pasting.
CardKit does not generate CSS for you and does not claim to "fix" Squarespace automatically. What it offers is narrower and, we think, more useful: a place to see what a block of CSS does before you commit to it, and the ability to change one value and watch.
Real scenarios
The shop owner and the pill buttons. She asked for rounded buttons and got
border-radius: 999px - technically what "rounded" means, visually a pill. Seeing it on
her own card, she dropped it to 10px in one adjustment instead of describing the difference in
another prompt.
The consultant with the heavy shadow. The generated shadow was calibrated for a light theme; his site is dark, so it read as a black smear. One look, one value changed.
The blogger whose newsletter button also changed. The generated selector matched every button on the site. She only noticed because she checked another page after pasting - the lesson behind step three of the safer workflow.
How to prompt so the output is easier to verify
Bad prompting is not why generated CSS goes wrong - the model cannot see your page - but a better prompt produces output that is easier to check. Four requests worth making every time:
- "Comment each property with what it does." You get annotations in the output, which turns an opaque block into something you can sanity-check line by line.
- "Tell me how broad the selector is and how to narrow it." Ask the model to state which elements the rule probably matches. It will be a guess, but the question puts scope in front of you instead of leaving it implicit.
- "Do not use !important, and say if a rule will not apply without it." If the answer is that it will not, that is useful information: it means the theme's own rule is winning, and the honest fix is a more specific selector rather than an override.
- "Give me the smallest rule that does only this." Models default to generous output - padding, letter-spacing, transitions and hover states you never asked for. Asking for the minimum keeps the block to one or two properties, which is exactly what you want to paste.
One more, which saves the most time of all: paste your actual class name into the prompt. Right-click the element, choose Inspect, copy the class, and include it. The model still cannot see your page, but it no longer has to guess the markup - and selector errors are the single largest source of "the CSS did nothing" or "the CSS changed everything".
Questions people ask
Should I just keep asking the AI until it gets it right?
You can, but the loop rarely converges. Each round trip returns a whole new block, so you are inferring what changed instead of seeing it. Two prompts and one visual adjustment beats six prompts - and you end up understanding your own CSS.
Is AI-generated CSS safe to paste?
The syntax is usually fine; the risk is scope and context, neither of which the model can know. Treat it as a first draft that must be seen before it is trusted, never as a finished answer.
Will this replace hiring a developer?
No. It removes the queue for small cosmetic changes - which is most of what people wait for. A new layout, a responsive rebuild or an accessibility audit remains professional work, and pretending otherwise is how sites end up fragile.
The short version
Writing CSS got easy. Deciding whether the CSS is right did not, because deciding is visual and the answer arrives as text. The practical response is not better prompting - it is a rendering step between generation and paste:
AI generates the first draft. You finish it visually.
If you want the property-by-property version of what to look for while finishing, What Those CSS Numbers Actually Do covers the twelve values that matter, and The 12 CSS Changes Squarespace Site Owners Make Most Often lists the requests they usually belong to. And the practical version of finishing a draft - take one, change the value, copy only what you changed - is in How to Edit AI-Generated CSS Without Asking AI to Rewrite Everything.