Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add z-index to Notification Toast ListWrapper #1359

Merged
merged 8 commits into from
Jan 13, 2022
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/smart-yaks-walk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sumup/circuit-ui': minor
---

Added a `z-index` to the NotificationToasts so they always float above other content.
amelako marked this conversation as resolved.
Show resolved Hide resolved
5 changes: 5 additions & 0 deletions .changeset/tame-pigs-worry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sumup/design-tokens': minor
---

Added a new `zIndex.toast` value for the NotificationToast component in Circuit UI.
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ const listWrapperStyles = ({ theme }: StyleProps) => css`
transform: translateX(-50%);
display: flex;
flex-direction: column-reverse;
z-index: ${theme.zIndex.toast};
`;

const ListWrapper = styled('ul')(listWrapperStyles);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ Object {
"navigation": 800,
"popover": 30,
"sidebar": 800,
"toast": 1100,
"tooltip": 40,
},
}
Expand Down
1 change: 1 addition & 0 deletions packages/design-tokens/themes/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,4 +208,5 @@ export const zIndex: ZIndex = {
sidebar: 800,
navigation: 800,
modal: 1000,
toast: 1100,
};
1 change: 1 addition & 0 deletions packages/design-tokens/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ export type ZIndex = {
sidebar: number;
navigation: number;
modal: number;
toast: number;
};

export interface Theme {
Expand Down
1 change: 1 addition & 0 deletions packages/design-tokens/utils/theme-prop-type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,5 +237,6 @@ export const themePropType = PropTypes.shape({
sidebar: PropTypes.number.isRequired,
navigation: PropTypes.number.isRequired,
modal: PropTypes.number.isRequired,
toast: PropTypes.number.isRequired,
} as { [key in keyof ZIndex]: Requireable<unknown> }).isRequired,
} as { [key in keyof Theme]: Requireable<unknown> });