Skip to main content

Theme Configuration

Themes control the visual presentation and user interface of your EverShop store. Unlike extensions which handle business logic, themes focus purely on the frontend experience.

Configuration Location

The active theme is configured in the system.theme property:
  • config/default.json - Base theme configuration
  • config/development.json - Development theme override
  • config/production.json - Production theme override

Theme Configuration Schema

string
required
The name of the active theme directory. This should match a directory name in the themes/ folder.Example: "anasuplements", "default", "custom"

Configuration Example

Here’s the actual theme configuration from your EverShop project:
This configuration is consistent across all environments:

Active Theme: anasuplements

The current project uses the anasuplements theme, which is designed for a supplements e-commerce store.

Theme Structure

Theme Package Configuration

Theme Components

The anasuplements theme includes:

Account Pages

  • Dashboard.tsx - Customer account dashboard
  • Login.tsx - Customer login page
  • Register.tsx - Customer registration page

Global Components

  • Header.tsx - Site-wide header navigation
  • Footer.tsx - Site-wide footer

Homepage Components

  • Hero.tsx - Hero section with main banner
  • FeaturedProducts.tsx - Featured product carousel/grid
  • Features.tsx - Store features/benefits section

TypeScript Configuration

Theme Development

Creating Page Components

Theme components are React components with special exports for layout configuration:

Component Areas

EverShop uses a flexible area system for component placement:

Sort Order

The sortOrder determines component rendering order within an area:
  • Lower numbers render first
  • Typical range: 10-100
  • Step by 10s to allow insertion

Changing Themes

Switch to a Different Theme

To change your active theme:
  1. Update config/default.json:
  2. Ensure the theme directory exists:
  3. Rebuild the application:
Changing themes requires a full rebuild. Always test thoroughly after switching themes.

Development vs Production Themes

You can use different themes per environment:

Creating a Custom Theme

Step 1: Create Theme Directory

Step 2: Create package.json

Step 3: Create tsconfig.json

Step 4: Create Components

Create your first component:

Step 5: Configure and Build

Styling and Assets

CSS/Tailwind Integration

EverShop themes typically use Tailwind CSS for styling:
The anasuplements theme uses a green/mint color scheme:
  • Primary: #2D5A3D (Green)
  • Background: #F8FAF9 (Pearl White)
  • Borders: #E8F5E9 (Light Green)

Static Assets

Place static assets in the public/ directory at the project root:
Reference in components:

Theme Organization

Page Component Structure

Organize components by their purpose:

Component Naming Conventions

  • Use PascalCase for component files: FeaturedProducts.tsx
  • Match directory names to page areas: frontStore, admin
  • Use descriptive names that indicate purpose: Hero.tsx, ProductGrid.tsx

Best Practices

Theme Development

  1. Component Isolation: Keep components focused on presentation
  2. Reusability: Create shared components in the all/ directory
  3. TypeScript: Use TypeScript for type safety
  4. Responsive Design: Design mobile-first with Tailwind utilities

Version Control

  • Commit theme source code (src/)
  • Exclude compiled output (dist/)
  • Document theme features in a README

Testing

Common Issues

Verify:
  1. Theme name in config matches directory name exactly
  2. package.json exists in theme directory
  3. You’ve run npm run build after configuration changes
  4. No TypeScript compilation errors
Check:
  1. Component exports default function
  2. layout export is properly configured
  3. areaId matches available areas
  4. No runtime errors in browser console
Ensure:
  1. Tailwind classes are correctly spelled
  2. Custom CSS is properly imported
  3. Build process completed successfully
  4. Browser cache is cleared

Next Steps

  • Explore the anasuplements theme source code
  • Customize theme components for your brand
  • Learn about Tailwind CSS integration
  • Create reusable component libraries