Create a theme

What salla theme create asks, writes and runs, and how to skip the questions.

Run salla theme create once, when you start a new theme. Run it in the folder where the new theme folder should appear.

salla theme create

Alias: salla theme c.

The questions

  1. Theme type. Choose the React theme (the default). The other choice is the legacy Twig theme, which this documentation does not cover.
  2. Name. 3 to 50 characters. The folder is the name as a slug: My Store becomes ./my-store.
  3. Store. The demo store (ready now, no login) or your own demo store (asks you to sign in). You can change it later, see Link a store.

Skip the questions

salla theme create --type react --name "My Store" --yes
OptionMeaning
-t, --type <type>react for a Twilight theme.
-n, --name <name>The theme name.
-s, --store <store>Bind this store id and skip the store question.
-y, --yesAccept the defaults: React theme, demo store, no prompts, no GitHub step.

What it does

Checks the toolchain

The same checks as salla theme doctor. Nothing is written yet, so a failure here costs nothing.

Downloads the starter

It fetches the published @salla.sa/theme-raed package (Salla's Raed theme) into the new folder. You start from a complete storefront, not an empty project. The command stops if the folder already exists.

Makes it yours

It renames the starter: name in package.json (and removes "private"), the name in twilight.json (Arabic and English), the name in the server config file, and the title of README.md.

Binds a store

It writes .env with the store you picked. See Link a store.

Starts git

git init, then an "Initial commit". If git has no identity configured the theme is still created, only without that commit.

Installs dependencies

pnpm install. If this fails the folder is kept: run pnpm install inside it.

Offers a GitHub repository

Interactive mode only (no --yes). If you are signed in and have a linked GitHub installation with full access, it creates a private repository and pushes the first commit to its default branch. Any failure only prints a warning and your local theme keeps working.

You need this repository to publish later. You can skip it now.

Starts the dev server

It hands over to salla theme dev and opens the storefront.

Use a different starter

To test an unpublished starter, set SALLA_THEME_TEMPLATE to a local .tgz file or a folder before running create. Most themes never need this.

Next: Run it locally

On this page