Browse articles

Custom CSS and styling with AI

Style your cart beyond the built-in settings - chat with AI to write the CSS, or write it yourself with EliteCart's classes.

Last updated

When the settings in Colors & styles and the other sections aren't enough, add your own CSS. You don't need to know CSS: describe the change in plain words and AI writes it for you. If you know CSS, you can write or edit it directly.

Open it under Cart designerCustom CSS, in the Other group. CSS changes show in the preview right away.

What to style

Choose Standard cart or Two-step cart. This decides which cart the preview shows and which cart the AI writes CSS for. Both share the same CSS code, so everything you add here applies to your store as one stylesheet. This is also the place to style the two-step cart.

Style with AI

The Style with AI card is a chat. Every message builds on the CSS you have, so you can refine a look step by step.

  1. Describe the change

    Type what you want into Describe your change, for example: "Make the checkout button fully rounded with a light gray shadow." Press Enter or click Send.

  2. Check the preview

    The CSS updates in the CSS editor and in the preview, and the reply says what changed. Each change is kept in the chat as a version, such as Version 1.

  3. Keep refining

    Send a follow-up like "now make it dark green with white text". You can also ask a question, such as "what else could you change in the header?", and the AI answers without touching your CSS.

  4. Save

    Review the result, then click Save in the save bar.

AI can make mistakes, so always look at the result in the preview, and in your store, before you keep it.

Go back to an earlier version

  • Click Restore next to any version in the chat.
  • Or type it: "undo that" or "go back to version 1".
  • New chat clears the conversation and keeps your CSS.
  • Start over removes all custom CSS and clears the chat.

The chat stays until you reload the page. Your saved CSS stays either way.

If the AI can't do part of a request with CSS, for example adding new text or buttons, it says so in the reply. Click Contact our team there and we'll help.

Write good prompts

  • Name the element: checkout button, cart header, product title, quantity buttons, upsells.
  • Name the change: colors as names or hex codes, sizes in pixels, "rounded", "bold", "more space above".
  • One or two changes per message work better than a full redesign. Build up the rest in follow-ups.
  • If the result is close, describe what is wrong now and how it should look instead.

"Make it look better" or "change the colors" is too vague.

Write CSS yourself

The CSS editor suggests EliteCart's classes as you type, and has its own undo and redo buttons. To see every class you can target, click Show EliteCart classes (.ec-) or Show Tailwind classes (.tw-) in the CSS editor card.

  • .ec- classes target a specific part of the cart. Prefer these.
  • .tw- classes are general utility classes used in many places. Overriding one changes every element that uses it.

A few common .ec- classes:

ClassElement
.ec-cart-containerThe whole cart
.ec-header-container, .ec-header-titleCart header and its title
.ec-lineitem-containerOne product row
.ec-lineitem-titleProduct title
.ec-quantity-adjusterQuantity − / + buttons
.ec-summary-containerCart summary
.ec-checkout-buttonCheckout button
.ec-banner-containerAnnouncement banner

To style only the two-step cart or only the standard cart, start your selector with .ec-mode-two-step or .ec-mode-standard:

.ec-mode-two-step .ec-lineitem-title {
  font-weight: bold;
}

The preview looks right, but my store doesn't

If the cart looks correct in the preview but different in your store, CSS from your theme or another app is usually overriding the cart's styles. Try these in order:

  1. Turn on Use Shadow DOM for CSS isolation under Cart designerAdvanced. It shields the cart from your theme's CSS. Your Custom CSS still applies. Styles you put into your theme's own files no longer reach the cart, so keep all cart CSS here.
  2. Make your selector more specific, for example #EliteCartContainer .ec-checkout-button instead of .ec-checkout-button.
  3. As a last resort, add !important to the property, for example color: blue !important;.

Still stuck? Send us a message in the chat. We can tell you which style is conflicting.

Still stuck?

Chat with us and we'll help you get your cart live. Or email contact@elitecart.app.