This steps below show how to use the Liferay Theme Generator’s Themelets sub-generator to create a themelet.
Your first step in creating a themelet is installing the Liferay Theme Generator if it’s not already installed. Once the generator is installed, you can follow these steps to create a themelet:
Open the Command Line and navigate to the folder you want to create your themelet in.
yo liferay-theme:themeletand follow the prompts to generate the themelet.
The generated themelet contains a
package.jsonfile with configuration information and a
src/cssfolder that contains a
_custom.scssfile. Just like a theme, add your CSS changes to the
To use your themelet, you must install it globally first. This makes the themelet visible to the generator. To install your themelet globally, navigate into its root folder and run
npm link. Note, you may need to run the command using
sudo npm link. This creates a globally-installed symbolic link for the themelet in your npm packages folder. Now your themelet is available to install in your themes.
Awesome! You just created a themelet with the Theme Generator’s Themelets sub-generator.