Zid Docs
AppsThemes
Payments
AppsThemes
Payments
Help Center
Slack
  1. Features
  • Getting Started
    • Introduction
    • Theme Development
    • Vitrin Changelog
    • Creating and Managing Theme Presets
    • Legacy Theme Migration
      • Store Settings Mapping
      • Moving to Vitrin Using LLMs
      • Twig to Jinja
      • Breaking Changes
  • Key Concepts
    • Architecture
    • Templates
      • Overview
      • Overridable Templates
      • Legacy Templates
      • Template Replacements
      • Templates Library
        • home.jinja
        • product.jinja
        • cart.jinja
        • category.jinja
        • products.jinja
        • categories.jinja
        • page.jinja
        • blogs.jinja
        • blog.jinja
        • faqs.jinja
        • reviews.jinja
        • questions.jinja
        • shipping_payment.jinja
        • 404_not_found.jinja
    • Settings
      • Schema files
      • Input Settings
      • Media Settings
      • Form Controls Settings
      • Products Settings
      • Additional Settings
      • Conditional Visibility
      • Migrating twig settings schema
    • Localization
      • localization (jinja v. twig)
    • Theme Editor
      • Overview
  • Building with Vitrin
    • Jinja Basics
    • Vitrin's Jinja Extensions
  • Vitrin CLI
    • Introduction
    • CLI Commands
  • Tips & Tricks
    • Performance
  • JS Integration
    • Supporting both Vitrin and Legacy themes
    • Responses & Errors
    • Cart
    • Products
    • Categories
    • Store
    • Account
    • Blogs
    • Options
    • Events
  • Features
    • SDK Popups – Integration Guidelines
    • Custom Styles Guide
    • Gift Card as a Popup
    • Addresses as a Popup
    • Login as a Popup
    • Checkout as a Popup
    • Apple Pay Quick Checkout
    • Region & Language Popup
    • Dynamic Bundle Products
    • Progressive Discounts
    • Customer Wallet & Cashback
    • Add Preorder Support to Your Theme
  • Mobile Apps
    • Scripts
  • API's
    • Authentication
      • Logout
      • Login Status
      • SMS Login
      • Verify SMS Login
      • WhatsApp Login
      • Verify WhatsApp Login
      • Email Login
      • Verify Email Login
      • Register
      • Register Guest
    • Products
      • List Products
      • Search Products
      • Calculate Product Options Price
      • Notify Product Stock Availability
      • Fetch Bundle Offers
      • Fetch Bundle Offers for a Product
      • List My Product Reviews
      • List Product Reviews
      • Create Product Review
      • Update Product Review
      • Delete Product Review
      • List Product Questions
      • Create Product Question
      • Get Product by Slug
      • Get Selection Groups
    • Categories
      • List Categories
    • Checkout
      • Get Cart
      • Remove Cart
      • Duplicate Cart
      • Add Cart Item
      • Empty Cart
      • Update Cart Item
      • Remove Cart Item
      • Upload Cart Input Field
      • Add Gift Card
      • Remove Gift Card
      • Apply Coupon
      • Remove Coupon From Cart
      • Check Coupon Validity
      • Apply Loyalty Points
      • Remove Loyalty Points
      • Preview Rewarded Points
      • List Redemption Methods for Cart
      • Customer’s Loyalty Wallet
      • Customer’s Current Points Balance
    • Account
      • Get Profile
      • Delete Account
      • Update Customer Profile
      • Get Addresses
      • Create an Address
      • Get an Address by ID
      • Update an Existing Address
      • Delete Address
      • Get Orders
      • Get Shareable Wishlist Link
      • Get Wishlist
      • Add Products to Wishlist
      • Remove Product from Wishlist
      • Get Address Form Schema
      • Check Product Purchase Status
    • Storefront
      • Store Scripts
      • Pages
      • Blogs
    • Countries
      • Get Countries
      • Get Cities By Country
  1. Features

Custom Styles Guide

Overview#

The Zid SDK allows you to customize the appearance of SDK components using custom CSS styles. This guide will help you write, test, and troubleshoot custom styles for your Zid store.

Quick Start#

Add your custom styles to the custom-styles.js file:

How It Works#

Automatic Scoping#

All your custom styles are automatically scoped to their specific component to prevent conflicts with other parts of your store.
Example:
This ensures your styles only affect the gift dialog, not other dialogs in your application.

Component Keys#

Each component has a unique key that you can use in your window.zidCustomStyles object. You can easily find this key from the template component key shown in the Custom Styles section of the template documentation or configuration panel.

Writing Custom Styles#

Rule 1: Use Flat Selectors Only#

Correct:
Wrong:
The SDK uses a flat CSS structure for performance and reliability. Nested selectors cause errors.

Rule 2: Use camelCase for CSS Properties#

Correct:
Wrong:
JavaScript object notation requires camelCase property names.

Rule 3: Start Selectors with Valid CSS Prefixes#

All selectors must start with one of these:
. (class selector) → .my-button
# (ID selector) → #my-element
@ (at-rule) → @media, @keyframes
: (pseudo-class) → :hover, :focus
Correct:
Wrong:

Rule 4: Don't Use Global Selectors#

Avoid global selectors such as:
body, html, :root, *
Use specific class selectors instead:

Using MUI Classes#

When customizing MUI components, you can target classes using this pattern:
Pattern:
.Mui[ComponentName]-[slotName]
Example:
Important Note:
Avoid targeting any dynamically generated MUI classes that contain hashes, such as:
.css-ae2u5c-MuiSlider-thumb
These classes are not stable and may change between builds. Always use the standardized MUI pattern instead.

Common Errors & Solutions#

Forbidden Global Selector#

[ZidError] Forbidden selector 'body' - Cannot scope global selectors
Fix: Replace global selectors with component-specific ones.

Nested Selector with &#

[ZidError] Nested '&' not allowed. Use flat selectors.
Fix: Flatten your selectors.

Invalid CSS Structure#

[ZidError] Invalid CSS structure at 'root'. Expected object, received string.
Fix: Make sure each component key contains an object of selectors.

Examples#

Example 1: Modern Auth Dialog#

Example 2: Minimalist Gift Dialog#


Testing Your Styles#

1.
Check the browser console for validation errors.
2.
Inspect elements using DevTools to confirm applied scoping.
3.
Test across devices, modes, and languages.

Summary#

DO:
Use flat selectors
Use camelCase properties
Use valid MUI class names
Support responsive design
DON’T:
Use nested & selectors
Use hashed MUI classes
Use global selectors
Modified at 2026-02-17 07:02:10
Previous
SDK Popups – Integration Guidelines
Next
Gift Card as a Popup
Built with