Creating a Custom Theme for Web Application

The fap10 theme is used in the web application by default. Themes are contained in the folder:

The theme includes the following files:

To create a custom theme for web application:

  1. Copy the existing theme fap10, paste it to the current folder and rename the theme. For example, custom_theme:

If required, themes can be put into any folder. The path to the folder with web application themes is set in the config.json file in the customThemesPath field.

  1. Open the theme.json configuration file for edit:

{
  "key": "custom_theme",
  "name": "Custom theme",
  "palette": {
    ...
  },
  "size": {
    ...
  },
  "typography": {
    ...
  },
  ...
}

Change field values:

If required, change the rest of the theme settings.

  1. Change icons contained in the icons folder.

  2. Specify theme key in the config.json file in the themes field:

"themes": ["custom_theme", "fap10"]

The first theme is used by default.

  1. restart the web application back end depending on the server in use:

sudo systemctl restart apache2-fp10.x-web

sudo systemctl restart httpd-fp10.x-web

sudo systemctl restart httpd2-fp10.x-web

  1. Clear browser cache if required.

After executing the operations the custom theme is used on opening the web application.

To use a different theme contained in the array of the themes field, use browser developer tools. Execute the command in the console:

Platform.Themes.select('<theme key>')

NOTE. The default theme will be used in the web application after the browser page is refreshed.

See also:

Questions and Answers