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

Improve snackbar centering #1172

Closed
mimarz opened this issue Mar 23, 2021 · 3 comments · Fixed by #1485
Closed

Improve snackbar centering #1172

mimarz opened this issue Mar 23, 2021 · 3 comments · Fixed by #1485
Assignees
Labels
🐛 bug Something isn't working core-react eds-core-react

Comments

@mimarz
Copy link
Contributor

mimarz commented Mar 23, 2021

Using pixels as default for centering an element is bad pratice.

Use dynamic values such as, 50% or 50vw

Using just left makes placement wrong. Use portals on body instead?

@mimarz mimarz added the 🐛 bug Something isn't working label Mar 23, 2021
@mimarz mimarz changed the title Improve snackbar centering values Improve snackbar centering Mar 23, 2021
@mimarz mimarz added the core-react eds-core-react label Mar 23, 2021
@pomfrida pomfrida self-assigned this Jul 13, 2021
@pomfrida
Copy link
Contributor

Dynamic value was already set; left: 50% and transform: translateX(-50%) but it's the iframe Storybook uses that makes it seem like the position is off.

We also have the prop leftAlignFrom which defaults at 1200px, so larger screens will get a left aligned Snackbar. Should we increase the default here?

@mimarz
Copy link
Contributor Author

mimarz commented Jul 13, 2021

Dynamic value was already set; left: 50% and transform: translateX(-50%) but it's the iframe Storybook uses that makes it seem like the position is off.

We also have the prop leftAlignFrom which defaults at 1200px, so larger screens will get a left aligned Snackbar. Should we increase the default here?

Maybe using vw unit for left positioning in css would work better then 🤔

@pomfrida
Copy link
Contributor

Maybe using vw unit for left positioning in css would work better then 🤔

We get the same result with vw unfortunately

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working core-react eds-core-react
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants