Generate a CSS module file
Create a file called animate.module.css in the build process, so we can import it in our React components that supports CSS modules
import animation from 'animate.css/animate.module.css'
And use like that
export const Animation = ({ name }) => (
<div className={animation[name]}>
{children}
</div>
)
<Animation name="pulse">Heart</Animation>
@linconkusunoki thanks for the suggestion we will add this on the next version of animate.css @eltonmesquita can you please review this one and add a proper label. Thank you!
Although I don't like the idea of adding a duplicated file just to fit the convention of a single boilerplate project (this is a CRA thing), this makes sense and can make developers life easier. So, yeah this will probably end up on the v4 release.
Just a small question, would be better to provide the minified or unminified version? I think that the end result will be the same...
Thanks for the suggestion!
@eltonmesquita awesome feedback thanks for the response.
Yeah, it's just to not create this file in the our personal projects and update it manually.
If the file is minified or not doesn't matter, because CRA will do it when runs the yarn build command.
Thanks for accepting my suggestion :smiley:
@linconkusunoki you're welcome! Expect this feature in v4.
The next version will be completely name-spaced and class clashing will be hardly a problem any time on any project. So, I think that we won't need the .module.css file. Any thoughts on that?
I agree. It would be purely an overhead on maintenance.
Cool. All settled then, I'll close this.
Thanks for the inputs!