Skip to Content
avatar image
Former Member

Use CSS style on HANA Cloud Platform

We have created a SAPUI5 application in which we use CSS. This works fine in the Web IDE (see screenshot).

However when we deploy the application to the SAP HANA Cloud Platform CSS doesn't seem to work (see second picture).

I think this has to do with the relative path to the CSS file. Next picture shows the structure of our application.

In the index file we link the CSS file.

<link rel="stylesheet" type="text/css" href="css/style.css">

In the controller of our view we define for example the Red number field and the Amber number field.

    var oTextviewRed = new sap.ui.commons.TextView({

                                text : "3",

                                design: sap.ui.commons.TextViewDesign.H1

                            }).addStyleClass("fontred");

    var oTextviewAmber = new sap.ui.commons.TextView({

                                text : "37",

                                design: sap.ui.commons.TextViewDesign.H1

                            }).addStyleClass("fontamber");

Does anyone has an idea how to solve this CSS issue in the HANA Cloud Platform?

Thank in advance.

Web IDE.PNG (101.5 kB)
Structure.PNG (33.6 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    Jun 04, 2015 at 09:44 AM


    In the WEB Ide the app is started with the index file in which the link to the css file is made.

    However when the app is started from the launchpad in HANA Cloud Platform the system starts the app with the component.js file. In the component.js just add the file to the includes and it will work fine.

    Regards,

    Henk


    Component.PNG (6.8 kB)
    Add comment
    10|10000 characters needed characters exceeded

  • May 26, 2015 at 02:53 PM

    Hello Henk,

    If the css file is small, would you consider using inline CSS in the index.html?

    Doing so reduces the number of network requests and unblocks rendering due to CSS being treated as a render blocking resource.

    Regards,

    Scott

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hello Scott,

      Thanks for your reaction. I moved the CSS styling to the index file and unfortunately the result is still the same. In the Web IDE it works fine but on the HANA Cloud Platform still no colors are visible.

      Regards,

      Henk