Theming is an important aspect for an OpenUI5 application. The different colors shown on the UI need to have a good contrast to each other in order to be easily distinguishable.
Applications need to provide the user with an option to switch themes.
If the application runs in the SAP Fiori launchpad, this is covered automatically.
There are two possible ways to change the theme:
sap-ui-theme=sap_hcb
sap.ui.getCore().applyTheme(“sap_hcb”);
You should avoid writing custom CSS. If you do need custom CSS for some reason, check to make sure everything is working fine on all available themes.
If a new theme is created, the color contrast between the elements should be checked. People with visual impairments and people using the application under less than ideal circumstances (bad monitor, sunlight hitting the screen, window reflections) may not be able to read the text easily if the contrast levels are insufficient. Specialized tools can help you to measure the color contrast.
DO |
---|
Use predefined CSS parameters in your CSS. You can find them in the following files
within the OpenUI5 library:
|
Use REM/EM instead of PX as a unit. |
Use the Flexible Layout concept in CSS. |
Use media-queries when flexible layouts do not meet UX expectations. |
Don't forget the Retina display. You need to provide 2 versions for an icon (icon.png and icon@2x.png). |
DON'T |
---|
Define a custom color. |
Define a custom font family. |
Set fixed width/height (except for some exceptions like images). |
Define writing-modes (left-to-right or right-to-left), as this is handled by the OpenUI5 control itself. |
Take a screenshot, put it into an image tool and convert it to black and white
Are there screen elements, lines or texts that are disappearing?
Check the color contrast for elements that disappear.
If time allows, check all contrasts of all elements.