# Create a great theme > Everything you need to design a theme people love to shop in and want to install: in the visual editor, or as code with the Sellstamp CLI. Page: https://sellstamp.com/docs/storefront/theme-guide ## Two ways to build a theme Pick the path that fits how you work. Both end with a store your customers can shop in. - **In the visual editor**: No code. Start from one of our themes, shape it with the design panel and sections, and publish. Themes made this way can be listed on the theme marketplace for other merchants. - **As code**: Write templates in Liquid, Nunjucks, Twig or plain HTML, test them locally with the Sellstamp CLI, and upload them to your store. Ideal if you are bringing a theme from Shopify, SellAuth or Tebex, or want full control of the markup. Parts 1 and 2 below cover each path. The quality rules, the checklist and publishing apply to both. ## Part 1: Start from the closest theme Open **Storefront → Theme** and browse the themes. Each one changes the structure of the store, not just its colours, so choose the one whose layout is closest to what you want, rather than the one with the nicest colours. Colours are the easiest thing to change later. Applying a theme writes to your draft, so you can try as many as you like. Customers see nothing until you publish. ## Set up the design system first The design panel is your theme’s foundation. Set it before you touch individual sections, so every page inherits it. 1. Typography: pick a heading face and a body face that pair well. Two families is plenty. 2. Colour roles: set the background, text and accent. Keep body text at a contrast of at least 4.5:1 against its background. 3. Surfaces and buttons: choose the card style, corner radius and button shape once, here, rather than per section. 4. Layout and density: decide how wide and how airy the store feels. 5. Header and motion: choose the header layout, and keep motion subtle. Leave a setting unset if you do not need it. An unset setting adds no styling, so the theme’s own defaults stay in charge. ## Compose pages with sections - Use live sections (product grid, category list, contact block) for anything that shows the catalogue. They always show real products and prices, in the customer's language. - Give every page a job: home sells, the product page converts, about builds trust, FAQ removes doubt. - Arrange the product page template carefully. Media, title, price, reviews, the buy form and delivery details are blocks you can order. Keep the price and the buy button visible without scrolling on a phone. - Avoid image galleries and picture columns with no image in them. An empty one shows as a heading over blank space. - Write layouts that work with any heading. Each store keeps its own main heading, so a theme must look good with a short one and a long one. ## Make it look great on phones Most shoppers will see your theme on a phone. Use the device tabs in the editor to check phone, tablet and desktop, and adjust padding and columns for each. Check the home page, a product page and the cart at phone width before every publish. ## Add your own HTML and CSS A custom code section accepts your own markup and styles when the built-in sections are not enough. - Style with classes, not `id` attributes, which are removed. - Your CSS only applies to its own section, so it is safe to experiment. - Scripts, event handlers, frames and forms are removed. If you need JavaScript, build a code theme (Part 2). - Add images through the media library and link them. ## Part 2: Build a code theme A code theme is a folder of templates and assets, uploaded as a zip. It renders your store’s browse pages: home, listings, product pages, blog and policies. Checkout, payment, orders, sign-in and the customer portal are always handled by Sellstamp, so they stay fast and secure whatever the theme does. - **Liquid**: Shopify's template language. Folders: layout/, templates/, sections/, snippets/, config/, locales/, assets/. - **Nunjucks**: SellAuth's template language. Folders: templates/, layouts/, snippets/, components/. - **Twig**: Tebex's template language. A layout.html extended by index.html, category.html, package.html and page.html. - **Static**: Plain HTML pages or the build output of a static site or single-page app. The Sellstamp CLI (`@sellstamp/cli`, Node 22 or later) checks and previews your theme as you build it. Its offline commands (`check`, `lint`, `pack` and `convert`) need no account. ## The theme manifest Put a `sellstamp-theme.json` at the root of the folder. It tells Sellstamp which engine to use and which file renders each page. Running `sellstamp theme convert` writes one for you. ``` { "format": 1, "name": "Northwind", "version": "1.0.0", "engine": "liquid", "layout": "layout/theme.liquid", "routes": { "home": "templates/index.json", "product": "templates/product.liquid" }, "settings": { "schema": "config/settings_schema.json", "defaults": "config/settings_data.json" }, "locales": "locales/", "assets": "assets/" } ``` - `format`, `name` and `engine` are required. - Route keys: `home`, `products`, `category`, `search`, `product`, `cart`, `blog`, `blog_post`, `faq`, `feedback`, `status`, `terms`, `privacy`, `refund` and `page`. Any page you leave out uses the built-in store page, so you can start with just home and product. - For a single-page app, use `"engine": "static", "spa": true`. - A settings schema becomes a settings form the merchant fills in, so expose the colours, text and images a merchant will want to change. ## Let the platform handle the essentials Some parts of every page come from the store’s settings, so a theme never has to build them and can never get them wrong: - The page title, description, canonical link, social tags, structured data and favicon. Your own versions of these are replaced; everything else in your stays. - The `lang` and `dir` attributes on ``. - Platform blocks. Place them where they fit your design with `platform_block`: `search`, `cart_drawer`, `language_switcher`, `currency_switcher`, `consent_banner` and `attribution`. The consent banner and attribution are always added, so give them a sensible spot. ``` ``` For the cart and checkout, use the product form (Liquid’s `{% form 'product' %}`) or the theme compatibility API from your own JavaScript: `GET /v1/cart` to price a basket, `POST /v1/checkout` to start checkout, and `GET /v1/search` for search. ## Translations and right-to-left languages - Put every string in `locales/.json` and print it with the `t` filter. Missing keys fall back to the default language. - Use logical CSS properties (`margin-inline-start`, not `margin-left`) so the theme works in Arabic, Hebrew, Persian and Urdu. - Never hard-code prices or currency symbols. Use the engine's money helpers, so every currency the store sells in displays correctly. ## Develop with live preview Create an API key with the `themes.read` and `themes.write` scopes under **Settings → API keys**, limited to your store. Then: ``` sellstamp theme check ./my-theme --pretty # what the import will say sellstamp theme lint ./my-theme --pretty # syntax, missing translations, accessibility sellstamp login --api-key - # paste your key sellstamp theme dev ./my-theme --shop # live preview on your store's real data sellstamp theme push ./my-theme # upload a new draft version ``` `theme dev` serves a preview at `localhost:4848` that re-renders every time you save, and prints a signed preview link that also runs your scripts. `push` never publishes; publishing is always done in the dashboard. Add the checks to your CI so a broken theme never ships: ``` - run: sellstamp theme lint ./theme - run: sellstamp theme check ./theme --strict ``` ## Keep it safe to install Every upload is scanned. A theme that follows these rules goes through without delay: - Never include secrets: private keys, live API tokens or .env files. A theme with one is refused. - Do not add password or card fields, and do not send form data to other sites. Checkout and sign-in are handled by Sellstamp; themes that collect them are held for review. - Avoid eval, encoded scripts and postMessage without an origin check. They are flagged to the merchant. - Load as few outside hosts as you can. The merchant approves each one, and each extra host is one more reason to say no. - Upload built files, not source. Nothing in a theme is installed or built. ## Accessibility rules every theme should pass `sellstamp theme lint` and the report on the Import page check each of these: - **One h1 per page**: And headings in order, without skipping a level. - **Landmarks**: A `
` and a `