Skip to Content

Embedding a custom CSS style class to a SAPUI5 control

The visual display of SAP UI5 controls can be edited in various ways. One simple way is to define an own CSS style class and to embed it to the SAP UI5 Control. It is verry simple:

Extending the SAP UI5 INDEX file

Add a new css class to the index.html. Of Course, there are also other ways (external css file, … ) – but in this example we will add the style-class direct in the index.html file;

democssclass1

Adjusting the SAP UI5

Use the method addStyleClass to add the new css class to the sap ui5 control:

democssclass2

Result

Not very surprisingly, the font color is whit, black background and italic:

democssclass3

14 Comments
You must be Logged on to comment or reply to a post.