company logo

Help center

Go to EliteCart
Powered by
All collectionsCart DesignerCustom Styling with CSS & AI

Custom Styling with CSS & AI

Customizing further with Ai-powered CSS generation

EliteCart comes with an incredibly powerful design editor that offers extensive styling and customization options. You can adjust important colors, layouts and styles with a click of a button using our intuitive interface and live preview. However, when you need that extra level of customization that goes beyond what our editor can achieve, the AI CSS Generator is available.

This advanced tool allows you to describe the changes you want in plain English, and our AI will automatically generate professional CSS code that targets your cart's specific elements.

info icon
If you’re familiar with CSS, you can of course also write your own CSS. EliteCart classes for you to target are auto-suggested in our smart editor.

What is AI CSS Generation?

The AI CSS Generator transforms natural language descriptions into professional CSS code. Instead of writing complex CSS rules manually, you can simply describe what you want to achieve, and our AI will:

  • Analyze your current cart structure

  • Generate CSS targeting the appropriate elements

  • Follow best practices for maintainable code

  • Respect your existing styles and customizations

How It Works

Our AI CSS generator uses cutting-edge LLMs to understand your requests and convert them into clean, professional CSS. Here's what happens behind the scenes:

  1. Structure Analysis: The AI examines your cart's HTML structure to understand what elements are available

  2. Smart Targeting: It identifies the best CSS classes to target (prioritizing EliteCart-specific .ec- classes)

  3. Code Generation: Professional CSS is generated following industry best practices

  4. Integration: The CSS seamlessly integrates with your existing styles

Getting Started

Accessing the AI Generator

  1. Navigate to Cart Design → Custom CSS

  2. Look for the AI Generate CSS button below the CSS editor

  3. Click the button to open the AI prompt interface

Writing Effective Prompts

The key to getting great results is writing clear, descriptive prompts. Here are some examples:

Good prompts:

  • "Make the corners of the checkout button fully round"

  • "Change the cart header to have a gradient background from blue to purple"

  • "Add a subtle border around each cart item"

  • "Make the quantity input buttons larger and more prominent"

  • "Style the checkout button with a green background and white text"

Bad prompts:

  • "Make it look better" (too vague)

  • "Change colors" (not specific enough)

  • "Fix the design" (unclear what needs fixing)

Understanding Your Options

When you have existing CSS, you'll see two options:

  • Modify existing: The AI will preserve your current CSS and add modifications to it

  • Start from scratch: The AI will create entirely new CSS based on your prompt

If you don't have any existing CSS, you'll simply see a Generate CSS button.

Best Practices

Writing Clear Descriptions

  1. Be specific: Instead of "make buttons better," say "make buttons more rounded with a subtle drop shadow"

  2. Mention colors: Use specific color names or hex codes when possible

  3. Describe layout changes: Clearly explain spacing, sizing, or positioning changes

  4. Reference specific elements: Mention cart header, product items, quantity buttons, etc.

Iterative Improvements

  1. Start simple: Begin with basic changes and build up complexity

  2. Test changes: Preview your cart after each generation to see the results

  3. Refine prompts: If the result isn't quite right, try rephrasing your request. Describe how things are currently looking and how they should be changed.

Understanding CSS Classes

EliteCart uses two main types of CSS classes:

EliteCart Classes (.ec-)

These target specific cart elements and are preferred for precise customization:

  • .ec-cart-header - Cart title and header area

  • .ec-cart-item - Individual product rows

  • .ec-quantity-input - Quantity selector buttons

  • .ec-checkout-button - Main checkout button

  • And many more...

Tailwind Classes (.tw-)

These are utility classes used for global styling:

  • .tw-text-lg - Text sizing

  • .tw-bg-blue-500 - Background colors

  • .tw-rounded-lg - Border radius

  • .tw-shadow-md - Drop shadows

The AI automatically chooses the most appropriate classes for your requests.

Troubleshooting

Common Issues

AI Generation Fails

  • Check that your prompt is descriptive enough

  • Ensure you're connected to the internet

  • Try simplifying your request

Results Don't Match Expectations

  • Refine your prompt with more specific details

  • Try the "Modify existing" option if you want to build on current styles

  • Break complex requests into smaller, simpler prompts

Preview Looks Perfect But Frontend is Broken

This is the most important troubleshooting scenario: If your cart preview in the EliteCart admin shows exactly what you want, but the live cart on your website looks different or broken, this indicates a style conflict issue.

What's happening: Your theme or another app is loading CSS styles that override the EliteCart styles. Even though the HTML structure is correct (which is why the preview works), external styles are interfering with your custom CSS.

How to identify this:

  • The cart preview in EliteCart admin looks perfect

  • The live cart on your frontend looks different, broken, or reverted to old styling

  • Styles may appear to be "fighting" each other

  • Elements may have incorrect colors, sizing, or positioning.

How to fix this:

  1. Use more specific CSS selectors: Instead of .ec-button, try #EliteCartContainer .ec-button

  2. Add !important declarations: Force your styles to take priority: color: blue !important;

  3. Increase CSS specificity: Use more detailed selectors like .ec-cart-container .ec-cart-item .ec-button

  4. Contact support: We can help identify which styles are conflicting and provide specific overrides

Why this happens: Shopify themes sometimes use very specific selectors to target rather generic elements. This is bad practice (precisely because it breaks other things in your store). This is invisible in the HTML structure but breaks the visual appearance.

Prevention: Always test changes on your live store, not just in the preview, especially after installing new apps or updating your theme.

CSS Conflicts

  • The AI considers existing styles, but conflicts can still occur

  • Use the preview to test changes before saving

  • Consider starting from scratch if there are too many conflicts

Performance

  • CSS generation typically takes less than less than 5 seconds, but can take longer in some cases.

  • No real impact on your cart's loading speed. Css is executed efficiently and quickly by the browser. You don’t ned to be afraid of it slowing down your store.

Tips for Success

  1. Preview First: Always preview changes in the cart designer before publishing

  2. Test on Live Store: Check your live cart, not just the preview, to catch style conflicts

  3. Save Backups: Keep copies of CSS that works well

  4. Iterate Gradually: Make incremental improvements rather than dramatic overhauls

  5. Test on Mobile: Ensure your changes work well on all device sizes

  6. Keep It Simple: Start with basic styling before moving to complex designs

Need more help? Our support team is available via chat to help you make the most of the AI CSS generator. We're here to ensure your cart design perfectly matches your brand vision.

Did this answer your question?
😞
😐
😁