Skip to content

Commit 2f8daaf

Browse files
committed
refactor(ui-modal,shared-types): remove unused theme variable, add docs on how to change Modal's z-index
the theme variable was not used anywhere Fixes INSTUI-4536
1 parent 8f8793a commit 2f8daaf

File tree

3 files changed

+25
-5
lines changed

3 files changed

+25
-5
lines changed

packages/shared-types/src/ComponentThemeVariables.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -834,7 +834,6 @@ export type ModalTheme = {
834834
mediumMaxWidth: Breakpoints['medium']
835835
largeMaxWidth: Breakpoints['large']
836836
boxShadow: Shadows['depth3']
837-
zIndex: Stacking['topmost']
838837
}
839838

840839
export type TransitionTheme = {

packages/ui-modal/src/Modal/README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1145,6 +1145,29 @@ const WrappedModalBody = withLogger(Modal.Body)
11451145
render(<Example />)
11461146
```
11471147

1148+
### Changing the Modal's z-index
1149+
1150+
You can do this with the `insertAt` prop or a theme override:
1151+
1152+
```jsx
1153+
---
1154+
type: code
1155+
---
1156+
<InstUISettingsProvider
1157+
theme={{
1158+
themeOverrides: {
1159+
componentOverrides: {
1160+
Mask: {
1161+
zIndex: 555,
1162+
}
1163+
}
1164+
}
1165+
}}
1166+
>
1167+
<Modal />
1168+
</InstUISettingsProvider>
1169+
```
1170+
11481171
### Guidelines
11491172

11501173
```js

packages/ui-modal/src/Modal/theme.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import { ModalTheme } from '@instructure/shared-types'
3131
* @return {Object} The final theme object with the overrides and component variables
3232
*/
3333
const generateComponentTheme = (theme: Theme): ModalTheme => {
34-
const { colors, typography, borders, breakpoints, shadows, stacking } = theme
34+
const { colors, typography, borders, breakpoints, shadows } = theme
3535

3636
const componentVariables: ModalTheme = {
3737
fontFamily: typography?.fontFamily,
@@ -48,9 +48,7 @@ const generateComponentTheme = (theme: Theme): ModalTheme => {
4848
mediumMaxWidth: breakpoints?.medium,
4949
largeMaxWidth: breakpoints?.large,
5050

51-
boxShadow: shadows?.depth3,
52-
53-
zIndex: stacking?.topmost
51+
boxShadow: shadows?.depth3
5452
}
5553

5654
return {

0 commit comments

Comments
 (0)