Have you ever wondered how you can preview your app in SAP Web IDE with your custom theme created in the UI Theme Designer?
In this blog I’ll explain how to test a theme that was created using the UI Theme Designer with an app developed in SAP Web IDE.
Prerequisites:
You have created a theme using the UI Theme Designer.
Step 1: Exporting the theme and importing it to SAP Cloud Platform.
- In the UI Theme Designer, open your theme.
- From the Theme menu, select Export.
A ZIP file will be downloaded to your computer.Notice that the option Save & Publish from the UI Theme Designer doesn’t do the same. This option deploys “.less” files, while using the export option we get “.css” files.
- Go to SAP Cloud Platform cockpit > Applications > HTML5 Applications and import the ZIP file:
Your theme is now an HTML5 application in the SAP Cloud Platform cockpit. You only need to activate it before you can continue.
- Click on the application name in the HTML5 application list.
- In the left panel, navigate to Versioning. Under History, select Versions and under Actions, activate the current version of the application as shown in the image below:

Step 2: Adjust your app to use the newly created theme.
In SAP Web IDE, select your project and make the following changes:
- Add the following route to the neo-app.json file as the first route:
{
"path": "/mythemepath",
"target": {
"type": "application",
"name": "mytheme"
},
"description": "My new theme"
},
- Adjust your app to use the theme. There are 2 ways to do this:
2.1. Using the URL parameters:
- Open the Run Configurations dialog by right-clicking on the project and selecting
Run > Run Configurations.
- Select the configuration you are using and go to the URL Components
- Add a URL parameter with the following values:
For example:

You can find the Theme ID in the UI Theme Designer’s home page:

2.2. Updating the HTML file:
- Open the HTML file you are using to preview your application.
- In the sap-ui-bootstrap tag, do the following:
- Edit the value of data-sap-ui-theme to your Theme ID as defined in UI Theme Designer
- Add the data-sap-ui-theme-roots property where the value is
‘{“<Theme ID>”: “/<the path as was defined in the neo-app route>/UI5”}’

- Click Run.
The application will be displayed using the cool new theme.

More information about Setting Themes for SAPUI5 Applications can be found in the
documentation.
Stay tuned to learn more tips and tricks for working with SAP Web IDE.