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

Ability to add positioning offset #108

Closed
jwheeler-gs opened this issue Dec 20, 2017 · 4 comments
Closed

Ability to add positioning offset #108

jwheeler-gs opened this issue Dec 20, 2017 · 4 comments
Assignees

Comments

@jwheeler-gs
Copy link

jwheeler-gs commented Dec 20, 2017

It looks like with the current setup, there is no way to add an offset to the toast container. For example, when I open a toast in "TOP_RIGHT", it's always 1em from top and 1em from right.

My application has a couple of menu bars at the top that I'd like to position the toast below, so I'd like to be able to specify a top offset of "110px" instead of 1em, but only for toasts positioned in TOP_. I can work around this right now by overriding the container style to always have a top offset of 110px, but that fails if I position any toasts using BOTTOM_.

@fkhadra fkhadra self-assigned this Dec 21, 2017
@fkhadra
Copy link
Owner

fkhadra commented Dec 21, 2017

Hey @jwheeler-gs,

What do you think if I allow defining those settings via the style helper? For instance:

import { style } from 'react-toastify';

style({
  TOP_LEFT: { top: '110px', right '110px' },
  BOTTOM_RIGHT: {/* style goes here and so on */ }
});

What do you think about the api ?

@jwheeler-gs
Copy link
Author

Yes, I think that would be fine. :D That's actually what I originally tried to do before looking at the code and seeing that it was not supported.

@fkhadra
Copy link
Owner

fkhadra commented Dec 21, 2017

Feature released.

@fkhadra fkhadra closed this as completed Dec 21, 2017
@jwheeler-gs
Copy link
Author

Excellent. Thanks @fkhadra!

vasiliydolmatov pushed a commit to vasiliydolmatov/react-toastify that referenced this issue Apr 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants