Overview
EverShop provides powerful CLI commands for theme management. Create custom themes, activate them, and create component overrides to customize your store’s appearance.Available Commands
evershop theme:create- Create a new themeevershop theme:active- Activate an existing themeevershop theme:twizz- Create theme overrides for components
theme:create
Create a new theme with a basic structure and starter component.Usage
Theme Name Rules
Theme names must:- Use only letters, numbers, dashes, or underscores
- Match pattern:
/^[A-Za-z0-9_-]+$/ - Be unique (not already exist)
Generated Structure
Creates the following structure:Generated Files
package.json
tsconfig.json
Component File (MyTheme.tsx)
Success Output
Error Cases
Invalid Name
Theme Already Exists
theme:active
Activate a theme by updating the configuration and optionally rebuilding.Usage
What It Does
- Lists Available Themes: Scans
themes/directory - Updates Configuration: Modifies
config/default.json - Optionally Builds: Runs
npm run buildif confirmed
Configuration Update
Updatesconfig/default.json:
Build Process
If you choose to build:Manual Build
If you skip the build:Success Output
Error Cases
No Themes Found
evershop theme:create.
theme:twizz
Create theme overrides for EverShop core components. This powerful command analyzes component dependencies and copies them to your theme.Usage
What It Does
-
Scans Available Components:
src/components/common/src/components/frontStore/src/modules/*/pages/frontStore/
-
Analyzes Dependencies:
- Finds relative imports
- Resolves import paths
- Builds dependency tree
-
Copies Files to Theme:
- Main component
- Optional dependencies
- Preserves directory structure
Dependency Analysis
The command parses imports:File Mapping
Component paths are mapped to theme structure:Components
Module Pages
Success Output
Customizing Overrides
After creating overrides, edit the files:Rebuild Required
After creating overrides:Theme Development Workflow
1. Create Theme
2. Activate Theme
3. Create Overrides
4. Customize
Edit files inthemes/my-store/src/
5. Build and Test
Theme Structure Best Practices
Organize by Feature
Use TypeScript
All theme files should use TypeScript for type safety:Export Layout Configuration
All page components should export layout config:Theme Configuration
Active Theme
Check active theme inconfig/default.json:
Multiple Themes
You can have multiple themes, but only one is active:Theme Switching
Switch themes without losing customizations:Advanced Usage
Override Entire Pages
themes/my-theme/src/pages/productView/ProductView.tsx
Create Custom Layouts
Add Custom Styles
Troubleshooting
Theme Not Applied
Solution: Rebuild after activating:Component Override Not Working
Solution: Check file path matches core component path structure.TypeScript Compilation Errors
Solution: Ensuretsconfig.json paths are correct:
Import Resolution Errors
Solution: Copy all dependencies when usingtheme:twizz.
Related Commands
evershop build- Build after theme changesevershop dev- Test themes in development
Resources
Component System
Learn about EverShop components
Theming Guide
Complete theming guide