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
* A full theme or an override object. The override only works for legacy
43
+
* (v11.6 or earlier) themes, for newer ones use the `themeOverride` prop.
42
44
*/
43
45
theme?: ThemeOrLegacyOverride
44
46
45
-
// TODO-theme-types: fix override typing
46
-
// TODO explain the usage of this override object. It will be deep merged into theme.themeOverride and the shape has to be a partial of the "newTheme" object
47
47
/**
48
-
* An override object for the new theming system.
48
+
* An override object for the new theming system. It will be deep merged into
49
+
* the theme. One can override primitives, semantics and individual component's
50
+
* themes, for example:
51
+
* ```js
52
+
* themeOverride={{
53
+
* semantics: {
54
+
* color: {
55
+
* stroke: {
56
+
* error: 'purple'
57
+
* }
58
+
* }
59
+
* },
60
+
* primitives: {
61
+
* color: {
62
+
* blue: {
63
+
* blue100: 'yellow'
64
+
* }
65
+
* }
66
+
* },
67
+
* components: {
68
+
* Alert: {
69
+
* background: 'brown',
70
+
* infoIconBackground: 'darkblue',
71
+
* borderWidth: '0.5rem'
72
+
* },
73
+
* Pill: {
74
+
* baseTextColor: 'purple',
75
+
* baseBorderColor: 'purple'
76
+
* }
77
+
* },
78
+
* sharedTokens: {
79
+
* focusOutline: {
80
+
* width: '0.55rem',
81
+
* infoColor: 'deeppink'
82
+
* }
83
+
* }
84
+
* }}
85
+
* ```
49
86
*/
50
-
themeOverride?: any
87
+
themeOverride?:
88
+
|NewThemeOverrideObject
89
+
|((theme: Theme)=>NewThemeOverrideObject)
51
90
52
91
/**
53
92
* @deprecated the `instanceCounterMap` prop is deprecated. You don't need to supply the
@@ -100,7 +139,6 @@ function InstUISettingsProvider({
100
139
* For backward compatibility reasons, the old way of passing a partial theme to the theme prop is still supported, however only for
101
140
* legacy (pre v11_7) components. Overriding the newTheme this way could break the system.
* @param themeOrLegacyOverride - A full theme or an override object
48
-
* @param themeOverride - if provided, it means it's a new theming-system override. This will be merged into theme.themeOverride and will be treated separately from the old way of applying overrides. This override will be applied in the withStyle.ts decorator
49
+
* @param themeOverride - if provided, it means it's a new theming-system override.
50
+
* This will be merged into theme.themeOverride and will be treated separately
51
+
* from the old way of applying overrides. This override will be applied in the
52
+
* `withStyle.ts` decorator
49
53
* @returns A function that returns with the theme object for the [ThemeProvider](https://emotion.sh/docs/theming#themeprovider-reactcomponenttype)
50
54
* This function is called by Emotion on theme provider creation, where
51
55
* `ancestorTheme` is a theme object from an ancestor `ThemeProvider`
0 commit comments