Skip to content
This repository was archived by the owner on Mar 4, 2020. It is now read-only.

Commit c501557

Browse files
Moving zIndex values to siteVariables (#2311)
* Moving zIndex values to siteVariables * Update Changelog * Fix changelog * Fix changelog * Move zIndex values from component styles to vars * refactoring * Comment changes * Update packages/react/src/themes/teams/siteVariables.ts Co-Authored-By: Oleksandr Fediashov <[email protected]> * PR comments fixes * Update chenglog Co-authored-by: Oleksandr Fediashov <[email protected]>
1 parent b157dc1 commit c501557

18 files changed

+46
-14
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
4949
- Add `target` prop to `EventListener` component and `useEventListener()` hook @layershifter ([#2287](https://github.com/microsoft/fluent-ui-react/pull/2287))
5050
- Add `disabled` prop accordion title @jurokapsiar ([#2290](https://github.com/microsoft/fluent-ui-react/pull/2290))
5151
- Allow custom values for `size` in `FlexItem` @silviuavram ([#2313](https://github.com/microsoft/fluent-ui-react/pull/2313))
52+
- Move `zIndex` values from default variable values and styles to siteVariables object in Teams theme @pompomon ([#2311](https://github.com/microsoft/fluent-ui-react/pull/2311))
5253

5354
### Documentation
5455
- Add per-component performance charts @miroslavstastny ([#2240](https://github.com/microsoft/fluent-ui-react/pull/2240))

packages/react/src/themes/teams/components/Chat/chatMessageStyles.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ const chatMessageStyles: ComponentSlotStylesPrepared<
9494
borderRadius: v.borderRadius,
9595
boxShadow: v.actionMenuBoxShadow,
9696
// we need higher zIndex for the action menu in order to be displayed above the focus border of the chat message
97-
zIndex: 1000,
97+
zIndex: v.overlayZIndex,
9898

9999
...(initialPopperStyles as ICSSInJSStyle),
100100

@@ -163,7 +163,7 @@ const chatMessageStyles: ComponentSlotStylesPrepared<
163163
width: 'auto',
164164
borderRadius: '50%',
165165
top: pxToRem(4),
166-
zIndex: 1,
166+
zIndex: v.zIndex,
167167
[sidePosition]: 0,
168168
transform: p.badgePosition === 'start' ? 'translateX(-50%)' : 'translateX(50%)',
169169
}

packages/react/src/themes/teams/components/Chat/chatMessageVariables.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ export interface ChatMessageVariables {
2929
reactionGroupBorderColor: string
3030
showActionMenu?: boolean
3131
timestampColorMine: string
32+
zIndex: number
33+
overlayZIndex: number
3234
}
3335

3436
export default (siteVars): ChatMessageVariables => ({
@@ -60,4 +62,6 @@ export default (siteVars): ChatMessageVariables => ({
6062
reactionGroupBorderColor: 'transparent',
6163
showActionMenu: undefined,
6264
timestampColorMine: siteVars.colors.grey[500],
65+
zIndex: siteVars.zIndexes.foreground,
66+
overlayZIndex: siteVars.zIndexes.overlay,
6367
})

packages/react/src/themes/teams/components/Dialog/dialogVariables.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export default (siteVariables): Partial<DialogVariables> => ({
3838
headerMargin: `0 0 ${pxToRem(8)} 0`,
3939

4040
overlayBackground: 'rgba(37, 36, 36, .75)', // todo: update to a palette value when daisy has mapped one
41-
overlayZIndex: 1000,
41+
overlayZIndex: siteVariables.zIndexes.overlay,
4242

4343
headerActionMargin: `${pxToRem(-3)} ${pxToRem(-8)} 0 0`,
4444
})

packages/react/src/themes/teams/components/Dropdown/dropdownStyles.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ const dropdownStyles: ComponentSlotStylesPrepared<DropdownPropsAndState, Dropdow
148148
borderStyle: 'solid',
149149
borderWidth: p.open ? v.listBorderWidth : '0px',
150150
borderColor: v.listBorderColor,
151-
zIndex: 1000,
151+
zIndex: v.overlayZIndex,
152152
maxHeight: v.listMaxHeight,
153153
overflowY: 'auto',
154154
width: getWidth(p, v),

packages/react/src/themes/teams/components/Dropdown/dropdownVariables.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ export interface DropdownVariables {
4141
toggleIndicatorSize: string
4242
triggerButtonColorHover: string
4343
width: string
44+
overlayZIndex: number
4445
}
4546

4647
const [cornerRadius, _12px_asRem] = [3, 12].map(v => pxToRem(v))
@@ -82,6 +83,7 @@ export default (siteVars): DropdownVariables => ({
8283
toggleIndicatorSize: pxToRem(32),
8384
triggerButtonColorHover: siteVars.bodyColor,
8485
width: pxToRem(356),
86+
overlayZIndex: siteVars.zIndexes.overlay,
8587

8688
// these should only apply when there is content in the image/media slot:
8789
listItemHeaderFontSize: siteVars.fontSizes.medium,

packages/react/src/themes/teams/components/Embed/embedStyles.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export default {
2929
':hover': {
3030
[`& .${Embed.slotClassNames.control}`]: {
3131
opacity: 1,
32-
zIndex: 1,
32+
zIndex: v.zIndex,
3333
},
3434
},
3535
}

packages/react/src/themes/teams/components/Embed/embedVariables.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ export interface EmbedVariables {
44
width: string
55
height: string
66
focusBorderColor: string
7+
zIndex: number
78
}
89

910
export default (siteVariables): EmbedVariables => ({
@@ -13,4 +14,5 @@ export default (siteVariables): EmbedVariables => ({
1314
width: undefined,
1415
height: undefined,
1516
focusBorderColor: siteVariables.colors.brand[500],
17+
zIndex: siteVariables.zIndexes.foreground,
1618
})

packages/react/src/themes/teams/components/List/listItemStyles.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ const listItemStyles: ComponentSlotStylesPrepared<ListItemStylesProps, ListItemV
7272
':focus': borderFocusStyles[':focus'],
7373
':focus-visible': {
7474
...borderFocusStyles[':focus-visible'],
75-
zIndex: 1,
75+
zIndex: v.zIndex,
7676
},
7777

7878
...(p.selected && selectedStyle(v)),

packages/react/src/themes/teams/components/List/listItemVariables.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ export interface ListItemVariables {
66

77
headerLineHeight: string
88
headerFontSize: string
9+
zIndex: number
910

1011
// Header Media
1112
headerMediaFontSize: string
@@ -31,6 +32,7 @@ export default (siteVariables: any): ListItemVariables => {
3132
return {
3233
minHeight: pxToRem(48),
3334
rootPadding: `0 ${pxToRem(18)} 0 ${pxToRem(20)}`,
35+
zIndex: siteVariables.zIndexes.foreground,
3436

3537
// Header
3638
// TODO: prod app uses 17.5px here, it should be 16px per the design guide!

0 commit comments

Comments
 (0)