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.
-
Run
yo liferay-theme:themelet
and follow the prompts to generate the themelet.The generated themelet contains a
package.json
file with configuration information and asrc/css
folder that contains a_custom.scss
file. Just like a theme, add your CSS changes to thesrc/css
folder, and add your JavaScript changes to thesrc/js
folder. -
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 usingsudo 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.