Styling & CSS Prompts

Prompt styling that uses your approach and tokens, describes layout in intent, and handles responsive and theming needs.

TL;DR

  1. State your styling approach, Tailwind, CSS Modules, styled-components, and your tokens.
  2. Describe layout by intent ('three equal columns that stack on mobile'), not pixel guesses.
  3. Ask for responsive behavior and theming explicitly; models default to one fixed desktop size.

Set The Approach

    Name The Method

    Tailwind, CSS Modules, styled-components, or plain CSS, be explicit.

    "Tailwind v4 utility classes only.
    No inline styles."
    Use Tokens

    Point at your design tokens so values stay consistent.

    "Spacing, color, radius from our
    tokens. No arbitrary values."
    Match Existing

    Reference a styled file to copy conventions.

    "Match the class patterns in
    Card.module.css."

Describe Layout By Intent

    Goal, Not Pixels

    Say what the layout should achieve and let the model pick mechanics.

    "Sidebar fixed 240px, content fills
    the rest, no horizontal scroll."
    Alignment & Flow

    Describe alignment, wrapping, and spacing behavior.

    "Items wrap, equal gaps, centered
    when there's one row."
    Overflow Rules

    State what happens when content is too long or too much.

    "Truncate with ellipsis; scroll the
    list, not the page."

Responsive & Theming

    Per-Breakpoint

    Say what changes at each breakpoint, not just 'make it responsive'.

    "3 cols >=1024px, 2 cols >=640px,
    1 col stacked below."
    Relative Units

    Prefer rem, %, and fluid sizing over fixed pixels.

    "Use rem and clamp(); avoid fixed
    px widths on text."
    Dark Mode

    Request a themeable variant tied to your mechanism.

    "Dark mode via CSS variables and
    our theme toggle."

Keep It Maintainable

    No Magic Numbers

    Replace stray pixels and hex with tokens and scales.

    "No one-off #3b82f6; use
    token 'primary'."
    Reduced Motion

    Ask animations to respect prefers-reduced-motion.

    "Wrap transitions in a
    prefers-reduced-motion guard."
    Check Real Widths

    Preview at phone, tablet, and desktop, not just your screen.

    Resize to 360px: does it stack
    cleanly?

Tips

  1. Give your spacing, color, and breakpoint tokens so styles are consistent and themeable.
  2. Describe the responsive behavior per breakpoint rather than hoping the model infers it.

Warnings

  1. Models reach for inline styles and hard-coded pixels and colors; insist on your tokens and utilities.
  2. Generated CSS often ignores dark mode, reduced motion, and small screens unless you ask.

In Practice

FAQ