How to style using Styled Components (Doc: https://fkhadra.github.io/react-toastify/how-to-style/#how-to-style-with-styled-components)
See original GitHub issueAre there any examples where <ToastContainer />
can be styled using styled-components
?
Currently doing this:
const ReactToastAdapter = ({ className, bodyClassName, progressClassName, ...props }) => {
return (
<ToastContainer
className={className}
bodyClassName={bodyClassName}
progressClassName={progressClassName}
{...props}
/>
)
};
const StyledToastContainer = styled(ReactToastAdapter).attrs({
bodyClassName: 'body',
progressClassName: 'progress',
})`
/* .Toastify__toast-container */
bottom: 0;
left: 0;
padding: 0;
margin: 0;
width: 100%;
.Toastify__close-button {
display: none;
}
.Toastify__toast {
background-color: var(--color-black);
margin: 0;
cursor: auto;
}
.toast {
background-color: var(--color-black);
}
.body {
background-color: var(--color-black);
color: var(--color-white);
font-family: var(--default-font-family);
}
`;
Issue Analytics
- State:
- Created 4 years ago
- Comments:12 (3 by maintainers)
Top Results From Across the Web
Styled Components - GitHub
Use the best bits of ES6 and CSS to style your apps without stress - GitHub - styled-components/styled-components: Visual primitives for the component ......
Read more >styled-components/tips-and-tricks.md at main - GitHub
A collection of useful tips and tricks when working with styled-components ! Component adjustments. Say you have a <Button> that has a padding...
Read more >VSCode Styled Components - GitHub
Syntax Highlighting is specifically made to work with styled so make sure your default import is styled and nothing else. ... Secondly make...
Read more >styled-components - GitHub
Visual primitives for the component age. Use the best bits of ES6 and CSS to style your apps without stress - styled-components.
Read more >A curated list of awesome styled-components resources - GitHub
Components. react-data-table-component - Data Table with built in sorting, pagination, selection, expandable rows and customizable styling.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
For those interested, you can work-around the warning mentioned in @ezeikel last comment by creating a wrapper component and applying the className to that instead:
Yeah, I’ll fork this project and send a PR with the modification asap.