SAPUI5/OpenUI5: CSS for custom control?

Daniel picture Daniel · May 27, 2014 · Viewed 7.4k times · Source

I am currently working on a custom control in SAPUI5/OpenUI5 and I am wondering how I can get the required CSS into the application. Where would I place the CSS code specific for my control? And how do I load it then from the control? I could not find anything in the documentation....

Thanks and best regards, Daniel

Answer

Tim Gerlach picture Tim Gerlach · May 27, 2014

In this tutorial, it's described how to use CSS in the renderer of custom controls.

If you're not using a custom renderer, you can attach CSS like to any other control like described here.

Always make sure that you load the CSS file e.g. in your html file.

Edit:

According to the comments jQuery.sap.includeStyleSheet() solved it.