Skip to Content
author's profile photo Former Member
Former Member

How to load css file in component.js?

Hi experts,

I create a css file with some css class,and declare it like this in index.html

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

local test is ok,but When I created a tile in launchpad with semantic, The app can't apply css,because it doesn't open via index.html,it open directly via component.js,so How to load css file in component.js or other solution?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    Posted on Aug 24, 2015 at 04:12 AM

    Hi Felix,

    Try including in metadata parameter 'include' of component -

    sap.ui.core.UIComponent.extend("", {
      metadata : {
      includes : [ "css/shell.css" ] //array of css and/or javascript files that should be used in the component

    Check this for more info - component.js File - UI Frameworks based on HTML5, JavaScript and CSS - SAP Library


    Sai Vellanki.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.