Skip to content

Commit

Permalink
[Snackbar] Only use the needed space (#8258)
Browse files Browse the repository at this point in the history
* Revert "[Snackbar] Fix click-through issue in IE11 (#8096)"

This reverts commit 277f3e6.

* [Snackbar] Only use the needed space
  • Loading branch information
oliviertassinari committed Sep 18, 2017
1 parent 7b4b53a commit ee3a5f4
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/Snackbar/Snackbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ export const styles = (theme: Object) => {
const bottomSpace = { bottom: gutter };
const rightSpace = { right: gutter };
const leftSpace = { left: gutter };
const center = {
left: '50%',
right: 'auto',
transform: 'translateX(-50%)',
};

return {
root: {
Expand All @@ -34,32 +39,36 @@ export const styles = (theme: Object) => {
alignItems: 'center',
},
anchorTopCenter: {
extend: [top],
extend: [top, center],
},
anchorBottomCenter: {
extend: [bottom],
extend: [bottom, center],
},
anchorTopRight: {
extend: [top, right],
[theme.breakpoints.up('md')]: {
left: 'auto',
extend: [topSpace, rightSpace],
},
},
anchorBottomRight: {
extend: [bottom, right],
[theme.breakpoints.up('md')]: {
left: 'auto',
extend: [bottomSpace, rightSpace],
},
},
anchorTopLeft: {
extend: [top, left],
[theme.breakpoints.up('md')]: {
right: 'auto',
extend: [topSpace, leftSpace],
},
},
anchorBottomLeft: {
extend: [bottom, left],
[theme.breakpoints.up('md')]: {
right: 'auto',
extend: [bottomSpace, leftSpace],
},
},
Expand Down

0 comments on commit ee3a5f4

Please sign in to comment.