You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
### Add `@ui5/webcomponents-react` to an existing app
41
43
42
44
First of all, you need to add the `@ui5/webcomponents-react` dependency to your project. Please also keep in mind installing the required peer dependencies:
@@ -87,22 +92,25 @@ import '@ui5/webcomponents-fiori/dist/Assets'; // only if you are using the Shel
87
92
88
93
You can now change the Theme by calling `setTheme` with a string parameter of the new theme.<br />
89
94
Available Themes:
95
+
90
96
-`sap_fiori_3` (default)
91
97
-`sap_fiori_dark`
92
98
-`sap_belize`
93
99
-`sap_belize_hcb`
94
100
-`sap_belize_hcw`
95
101
96
102
### Configure Compact/Cozy setting
97
-
UI5 Web Components supports ```Compact``` and ```Cozy``` mode. It is set to ```Cozy``` by default. To enable ```Compact```, provide the css class ```ui5-content-density-compact``` to any of your HTML elements and it apply compact size to all of its children.
103
+
104
+
UI5 Web Components supports `Compact` and `Cozy` mode. It is set to `Cozy` by default. To enable `Compact`, provide the css class `ui5-content-density-compact` to any of your HTML elements and it apply compact size to all of its children.
98
105
99
106
```html
100
-
<bodyclass="ui5-content-density-compact">
101
-
...
102
-
</body>
107
+
<bodyclass="ui5-content-density-compact">
108
+
...
109
+
</body>
103
110
```
104
111
105
112
### Support
106
-
Feel free to open issues or ask us directly in the [`#webcomponents-react`](https://openui5.slack.com/archives/CSQEJ2J04) channel in the
113
+
114
+
Feel free to open issues or ask us directly in the [`#webcomponents-react`](https://openui5.slack.com/archives/CSQEJ2J04) channel in the
107
115
[OpenUI5 Community Slack](https://ui5-slack-invite.cfapps.eu10.hana.ondemand.com/).<br />
108
116
Please note that you have to join this slack workspace via [this link](https://ui5-slack-invite.cfapps.eu10.hana.ondemand.com/) if you are not part of it already.
You can easily change the appearance of the Web Components by using [CSS Variables](https://www.w3schools.com/Css/css3_variables.asp).
13
14
Per default, we are injecting the Fiori 3 theme parameters as CSS Variables into the `document head`.
14
15
If you want to change e.g. the color of all texts, you can do that by creating another `style` element with the following content:
16
+
15
17
```html
16
18
<style>
17
-
--sapTextColor: limegreen;
19
+
--sapTextColor: limegreen;
18
20
</style>
19
21
```
22
+
20
23
As a consequence, all HTML Elements in the subtree where this style was applied are now displaying their texts in `limegreen` instead of `#32363a` which would be the default value for Fiori 3.
21
24
You can change CSS Variables on any level - in the head, or on every single element by using either CSS classes or elementstyle.
22
25
23
-
A full list of all supported CSS Variables can be found [here](https://github.com/SAP/ui5-webcomponents-react/blob/master/packages/base/src/styling/sap_fiori_3.ts)
26
+
A full list of all supported CSS Variables can be found [here](https://github.com/SAP/ui5-webcomponents-react/blob/master/packages/base/src/styling/sap_fiori_3.ts)
24
27
or in the [SAPUI5 Theming Parameters Toolbox](https://sapui5.hana.ondemand.com/test-resources/sap/m/demokit/theming/webapp/index.html).
25
28
26
29
## Reuse global style classes
30
+
27
31
The `ThemeProvider` component is offering global css classes that can be reused in your applications code to help you to achieve a Fiori look-and-feel.
28
32
All globally available style classes are tracked in the `GlobalStyleClasses` enum which can be imported from `import { GlobalStyleClasses } from "@ui5/webcomponents-react/lib/GlobalStyleClasses";`.
29
33
30
-
|CSS Class|Description|
31
-
|---------|-----------|
32
-
|`sapScrollBar`|If added to an container that supports scrolling, the scrollbar will be styled according to the Fiori guidelines. |
This guide is applicable if you are using a standard `create-react-app` setup.
9
8
10
-
11
9
## Install the jsdom 16 jest environment
10
+
12
11
As the UI5 Web Components are based on the `customElements` Web Standard, you need to install the latest version of `jsdom` to your project and tell the `jest` test runner to use it.
13
12
Therefore you need to install the `jest-environment-jsdom-sixteen` npm package.
0 commit comments