Back

Switching Themes


Ideally an application has a consistent look and feel in a browser, which means all its web pages follow the same style and branding rules as each other. To help with this, the Developing with Themes tutorial demonstrates how to configure your Verj.io Studio so that all new Forms use the same Theme. 

Reusing the same Theme in this way also makes it easy to change the look of the entire application by reconfiguring the Theme, or by swapping in a different Theme entirely. This is true at both design time, for example to change the application’s colour palette, and at runtime by offering different style options to end-users, for example, a light or dark mode.

Changing to a different theme at runtime requires a simple server event to be executed when an end-user clicks on a button, for example.

All Forms configured to use their owning Project’s Theme can be dynamically updated to use a different Theme, using the Verj.io JavaScript API function projects.setTheme(path_to_theme).

For this to work as expected, all Projects should to be linked to the new Theme’s owning Project. It is therefore recommended that all Themes are in the same Project as each other.

Web Pages are styled using Property Sets. It is important that the new Theme has the same collection of Property Sets as the old Theme, otherwise some aspects of your Web Pages may no longer render as expected.