How to apply custom theme from Theme Builder to standalone SAPUI5 app in index.html?

16 views Asked by At

I made a custom SAPUI5 theme through transaction /UI5/THEME_DESIGNER in S/4HANA on premise and successfully applied it to my Fiori launchpad.

Can I somehow reuse it in my standalone SAPUI5 app without adding it to the url?

What I tried so far:
In my index.html

<script id="sap-ui-bootstrap" 
    data-sap-ui-theme="<custom_theme>"
...

This successfully causes some CSS downloads in the network tab, like from

  • <hostURL>/sap/public/bc/ui5_ui5/1/resources/sap/ui/layout/themes/<custom_theme>/library.css
    but nothing happens visually.

Only when I add

  • ?sap-theme=<custom_theme>@<hostURL>/sap/public/bc/themes/~client-<client>/~cache-p

to the url it suddenly works. This proofs to me that I just don't understand how to add the theme in my index.html - I tried many different approaches, like adding data-sap-ui-theme-roots but can't figure out what the correct syntax/path is...

0

There are 0 answers