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
Copy file name to clipboardExpand all lines: docs/guides/using-theme-overrides.md
+28Lines changed: 28 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -179,6 +179,34 @@ type: code
179
179
</InstUISettingsProvider>
180
180
```
181
181
182
+
#### Override function
183
+
184
+
The `InstUISettingsProvider` accepts a `function`. The override function's first parameter is the currently applied theme object. It should return a valid theme or override object.
185
+
186
+
```js
187
+
---
188
+
type: example
189
+
---
190
+
<div>
191
+
<div>
192
+
<InstUISettingsProvider theme={
193
+
(theme)=>{
194
+
return {
195
+
componentOverrides: {
196
+
Alert:{
197
+
infoBorderColor:theme.colors.contrasts.red4570
198
+
}
199
+
}
200
+
}
201
+
}
202
+
}
203
+
>
204
+
<Alert>Overridden Alert</Alert>
205
+
</InstUISettingsProvider>
206
+
</div>
207
+
</div>
208
+
```
209
+
182
210
### Overriding theme for a single component
183
211
184
212
Themeable components (that implement the [withStyle](#withStyle) decorator) accept a `themeOverride` prop. This prop let's you override the component's own theme. It accepts an object or a function.
0 commit comments