close

Filter

loading table of contents...

Frontend Developer Manual / Version 2304

Table Of Contents

5.1 Creating a New Theme

The CoreMedia Frontend Workspace provides a script to easily create a new minimum theme skeleton, including brick configuration and theme inheritance. It works on macOS, Windows, and Linux.

Quick Overview
pnpm install
pnpm run create-theme <name>
pnpm install
cd themes/<name>-theme
Installation

After running pnpm install the script is ready to be used like all provided scripts.

You’ll need to have Node = 18.x on your machine. You can use nvm to easily switch Node versions between different projects.

This tool does not need a Node backend. The Node installation is only required for tooling.

Usage

To create a new theme, run (replace <name> with a name according to the rules below):

pnpm run create-theme <name>
pnpm install
cd themes/<name>-theme

It will create a directory with the pattern <name>-theme inside the themes folder, after asking for some configuration.

The tool lets you decide which bricks you want to include into your dependencies when creating the theme and asks if you want to keep the unused bricks as commented out dependencies in your newly created theme. It also allows you to select an existing theme as the parent of the new one. Learn more about how to extend themes in Section 5.5, “Theme Inheritance”.

Inside that directory, it will generate the initial theme structure as described in Section 4.2, “Theme Structure”.

You´ll need to run pnpm install from the root of the frontend workspace to install the dependencies of the new theme before the theme can be used.

Note

Note

The theme name should be a simple ASCII name. Whitespace and special characters are stripped and the name will be lowercase.

Search Results

Table Of Contents
warning

Your Internet Explorer is no longer supported.

Please use Mozilla Firefox, Google Chrome, or Microsoft Edge.