Replacing Styles of Backoffice Application
It is possible to replace the standard look and feel of the Backoffice Application. You can change the style sheet used in login page and main application pages including all components.
Follow the steps to replace standard SCSS (or CSS) files for login page and main application page. Create your own SCSS files and amend application configuration, so that it uses your custom files.
Create SCSS
Use Sass and SCSS files to style your Backoffice application.
Context
See an example of changing the login page style using SCSS. (Alternatively, create CSS. For more information, see the Create CSS).
Procedure
Create CSS
As an alternative to SCSS, you can use CSS files to style your Backoffice application.
Context
Use the sample CSS files and images to see how to style your application.
Procedure
Change Default Configuration
Amend the default configuration to apply the changes.
Procedure
backoffice.cockpitng.mainpage.css=/cng/css/mainpage_myextension.css backoffice.cockpitng.loginpage.css=/cng/css/loginpage_myextension.css backoffice.cockpitng.overridewidgetsandeditors.css=/cng/css/customWidgetsAndEditors.css
Configure Fonts
Change the fonts used in Backoffice.
Context
By default, font 72 is used in Backoffice. Other fonts including Open Sans and Roboto are also available. For more information on font 72, see Font 72
.
In the ZK Framework, you can configure the usage of the Google Font in Atlantic Theme. You can disable it or include it in an alternative way.
In the environments where you can't access Google servers (for example, Backoffice used in intranets), it is necessary to prevent loading Google fonts.
Procedure
Use Icons
Use icon font in Backoffice.
Context
Backoffice uses icon fonts instead of images. The OOTB icon fonts include SAP Icons and Commerce_BO_extended. All icon names are defined in the fd-icon-settings.scss configuration file.
-
It's in essence simple text. You can use CSS style rules to easily change and modify color and size/resolution, apply box-shadow, and apply CSS animations and transitions.
-
It's able to scale up perfectly to any resolution without any degradation or loss of visual quality.
-
It can change color automatically based on selected theme, no additional effort needed.
Procedure
Next Steps
Restart the server.
Configure Icons
Backoffice OOTB supports two icon font families, SAP Icons and Commerce-BO-icon. You’re recommended to use these predefined icons when developing extensions, but you can also import and use your own icons in the extensions.
Add new icon font in custom extension
A new extension named iconfont is used as an example.
-
Put all fonts files into the /cng/css/fonts folder.
-
Create custom-icons.css in the /cng/css folder.
-
Import new @font-family custom-icons as the following:
@font-face { font-family: "custom-icons"; font-style: normal; font-weight: normal; src: src: url("./font/icofont.eot"), url("./fonts/icofont.woff2") format("woff2"), url("./fonts/icofont.woff") format("woff"), url("./font/icofont.ttf") format("truetype"), url("./font/icofont.svg#icofont") format("svg"); /* Better Font Rendering =========== */ -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
Edit the local.properties file
In the local.properties file, add the path of the custom-icons.css as the following:
backoffice.cockpitng.custom.iconfont.css=/cng/css/custom-icons.css
Use new icons in different cases
-
Explorer-Tree
If you want to append some custom navigation nodes to the explorer-tree of Administration Console, for example:
iconfont-backoffice-config.xml Apply new icons for the first-level nodes (iconfont_treenode_fox and iconfont_treenode_elephant) in explorer-tree by adding the following content in iconfontwidget.scss: -
Button
If you want to add display icons for some buttons in the custom widgets, for example:
iconfontwidget.zulAdd related classes in the iconfontwidget.scss file:
-
Widget
If you want to render icons in your widget, for example:
iconfontwidget.zulAdd related classes in the iconfontwidget.scss file: -
Action
When you implement a new action, you can specify the icon name to the iconUri property. You can find the available icon name from SAP-icons or in your custom icon font family, for example:
definition.xmlAdd related classes in the iconfontwidget.scss file: