Tina Chen
Tina Chen

Reputation: 2030

How to change ui5 theme in component-based app of HCP WebIDE?

When I run webide project in UI5, it use sap_bluecrystal theme(webapp/resources/sap/ui/core/themes/sap_bluecrystal/library.css), but when I register my project to Fiori Launchpad of Portal Service, the theme changed to sap_belize.(resources/sap/fiori/themes/sap_belize/library.css?version=1.44.11&sap-ui-dist-version=1.44.11)

I want the theme to be consistent, I changed the manifest.json but it did not work:

"sap.ui": {
    "supportedThemes": [
        "sap_belize"
    ]
}

And in Project Settings -> SAPUI5, it can only change UI5 versions, not theme.

Upvotes: 2

Views: 5166

Answers (2)

santhosh
santhosh

Reputation: 476

You can even force the app to load the theme with this code

sap.ui.getCore().applyTheme("sap_belize"); 

Initialise this either in component.js or the initial view onInit method.

Upvotes: 2

loki
loki

Reputation: 648

Are you mentioning the theme while bootstrapping as follows:

<script id="sap-ui-bootstrap" 
            src="https://sapui5.hana.ondemand.com/resources/sap-ui-core.js"         
            data-sap-ui-theme="sap_bluecrystal" ... > </script>

Maybe this can help it become consistent.

Upvotes: 2

Related Questions