elbe-ui 2.0.2 → 2.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -26,6 +26,14 @@ function _App(p) {
26
26
  p.config,
27
27
  p.themeSelector,
28
28
  ]);
29
+ useMemo(() => {
30
+ if (p.config.noGlobalStyles)
31
+ return;
32
+ // apply global background of html and body elements
33
+ const bg = themeSelected.theme.color.currentColor.back.asCss();
34
+ document.documentElement.style.backgroundColor = bg;
35
+ document.body.style.backgroundColor = bg;
36
+ }, [themeSelected, p.config.noGlobalStyles]);
29
37
  const menuItems = useMemo(() => {
30
38
  return _extractMenuItems(p.children);
31
39
  }, [p.children]);
@@ -9,6 +9,8 @@ export type AppConfig = {
9
9
  routerConfig?: {
10
10
  basePath?: string;
11
11
  };
12
+ /** If true, global styles will not be applied. This can be useful for embedding Elbe in an existing app with its own styles. */
13
+ noGlobalStyles?: boolean;
12
14
  };
13
15
  type _MenuState = {
14
16
  isOpen: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "elbe-ui",
3
- "version": "2.0.2",
3
+ "version": "2.0.3",
4
4
  "author": "Robin Naumann",
5
5
  "license": "MIT",
6
6
  "repository": {