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 change font-family #107

Closed
bogdansoare opened this issue Dec 18, 2017 · 10 comments
Closed

Ability to change font-family #107

bogdansoare opened this issue Dec 18, 2017 · 10 comments
Assignees

Comments

@bogdansoare
Copy link

Is there anyway to change the font-family?
Or maybe let it inherit from the body and not set it as sans-serif

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

fkhadra commented Dec 18, 2017

I don't know why I didn't think about it before. Thanks @bogdansoare for the suggestions.

@fkhadra
Copy link
Owner

fkhadra commented Dec 18, 2017

Hey @bogdansoare,

Actually, it can already be done:

For all toast:

<ToastContainer toastClassName={css({ fontFamily: "Times New Roman, Serif" })} />

Per toast:

toast(content, {
  className: css({ fontFamily: "Times New Roman, Serif" })
});

Anyway, I'll probably allow to set it via the style helper.

@fkhadra
Copy link
Owner

fkhadra commented Dec 21, 2017

Feature released.

@fkhadra fkhadra closed this as completed Dec 21, 2017
@khaoptimist97
Copy link

Hi @fkhadra . I use style hepler to set font family for ToastContainer but it doesn work: <ToastContainer position="bottom-right" autoClose={3000} hideProgressBar={false} newestOnTop={false} closeOnClick rtl={false} pauseOnVisibilityChange draggable pauseOnHover transition={Zoom} style={{ fontFamily: 'Patrick Hand, cursive' }} />
I using google font Patrick Hand for the body. Please help me

@fulanovic
Copy link

Put styles in CSS class adn apply it with toastClassName='className'

@sgehrman
Copy link

sgehrman commented Oct 3, 2021

didn't work. Which css()? I have one in Chakra. Doesn't work. Why can't this be normal scss modules?

@ex-ali-edx
Copy link

Hi @fkhadra . I use style hepler to set font family for ToastContainer but it doesn work: <ToastContainer position="bottom-right" autoClose={3000} hideProgressBar={false} newestOnTop={false} closeOnClick rtl={false} pauseOnVisibilityChange draggable pauseOnHover transition={Zoom} style={{ fontFamily: 'Patrick Hand, cursive' }} /> I using google font Patrick Hand for the body. Please help me

Thankyou... this has been helpful to me.. :)

@Xaypanya
Copy link

Xaypanya commented Jan 7, 2023

Hey @bogdansoare,

Actually, it can already be done:

For all toast:

<ToastContainer toastClassName={css({ fontFamily: "Times New Roman, Serif" })} />

Per toast:

toast(content, {
  className: css({ fontFamily: "Times New Roman, Serif" })
});

Anyway, I'll probably allow to set it via the style helper.

thanks

@avneetmalhotra
Copy link

A better way to do it would be to override the css variable "--toastify-font-family"
ref - https://fkhadra.github.io/react-toastify/introduction/

If you want to inherit from body you can do:-
--toastify-font-family: inherit;

Or if you like to override it then:-
--toastify-font-family: Serif;

@MiladJoodi
Copy link

put :
.Toastify__toast-body { font-family: 'FONT-NAME'; }

in your .css file

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

9 participants