Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds theme info to the docs #4059

Merged
merged 6 commits into from
Dec 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 23 additions & 16 deletions docs/general-settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -262,29 +262,36 @@ You can set the following values:

### theming
- **description**: a configuration element that allows you to specify a list of themes that are available on the website. The children elements are:
* **themes** (mandatory) is an array of available themes, for example `themes: ['light', 'dark']`.
* **themes** (mandatory) is an array of available themes, for example `themes: ['light', 'dark', 'sap_horizon']`.
* **defaultTheme** (mandatory) the default theme used by the application.
* **nodeViewURLDecorator** (optional) you can add an internal Luigi View URL decorator (an example is below). This object adds a query parameter where you can add a current theme used by the application when micro-frontends are loaded.
* **useFioriScrollbars** (optional) if set to `true`, Fiori theming variables are applied to all scrollbars in luigi core app.
* **variables** (optional) can either be a string set to `fiori` to get all CSS variables from the `fiori` theme, or an object with a property called `file` where you can declare your own CSS variables. The variables should be defined in a JSON file which starts with a `root` key. An example of how a CSS variables file should look like can be found [here](https://github.com/SAP/theming-base-content/blob/master/content/Base/baseLib/sap_horizon/variables.json).
- **example**:
```javascript
theming : {
themes: () => [
{ id: 'light', name: 'Fiori3 Light' },
{ id: 'dark', name: 'Fiori3 Dark' }
],
defaultTheme: 'light'
nodeViewURLDecorator: {
queryStringParameter: {
keyName: 'sap-theme'
// optional
value: themeId => {
return themeId;
}
}
}
theming: {
themes: () => [
{ id: 'light', name: 'Fiori3 Light' },
{ id: 'dark', name: 'Fiori3 Dark' },
{ id: 'sap_horizon', name: 'Morning Horizon' }
],
defaultTheme: 'light',
nodeViewURLDecorator: {
queryStringParameter: {
keyName: 'sap-theme',
// optional
value: themeId => {
return themeId;
}
}
}
}
```

<!-- add-attribute:class:warning -->
> **NOTE:** The Horizon theme stylesheet needs to be included. In the HEAD section of your application's `index.html` file, add:
```html
<link rel="stylesheet" href="<PATH/TO/LUIGI/PACKAGE/luigi_horizon.css" />
```

### webcomponentCreationInterceptor
Expand Down
Loading