Customize Your Themes Using CSS
The introduction of CSS brings more flexibility to the styling in your analytic applications. You can define multiple CSS classes either as global default or per widget. The stylings conform to CSS standards and are no longer limited to the existing styling properties provided by SAP Analytics Cloud, analytics designer.
Learning Tutorial
Watch the interactive tutorial for step-by-step instructions; all tutorials are captioned exclusively in English:
Define and Apply CSS
You can define CSS in the CSS editor and apply it to individual widgets, popups or the whole application.
Procedure
Results
At design time, you can see that your application immediately applies the styling after you've defined and assigned the CSS class.
Later to let application users set CSS styling at application runtime, you can use script APIs such as setCssClass() and getCssClass(). For more information, refer to Analytics Designer API Reference.
The CSS you've defined for a widget won’t be carried to the new window if you create a story from it or open it in explorer.
Some CSS you've defined for a table might be different if its optimized presentation mode is enabled.
Enable and Load Theme CSS
You can enable theme CSS for your application and load it into the theme that can be applied across applications. The CSS settings will overwrite the existing theme settings but be overwritten by the settings in Styling panel of any widget or popup.
Procedure
- In the Display section of the toolbar, go to (Theme), select (Preferences) beside the theme you want to modify.
- In the General section under Application Settings, toggle on Enable Theme CSS.
- Select Load Application CSS.
- Select Save to save the theme with CSS or Save As to save a new theme.
Results
The priority of styling methods from highest to lowest is: widget styling defined in the CSS editor, widget styling from theme CSS, widget styling defined in the styling panel and widget styling defined in the theme preferences. Thus, for example, the styling rules coming from CSS classes will be prioritized over the overlapping styling rules coming from the styling panel settings.