animate.css icon indicating copy to clipboard operation
animate.css copied to clipboard

Generate a CSS module file

Open linconkusunoki opened this issue 7 years ago • 8 comments

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 avatar May 08 '19 12:05 linconkusunoki

@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!

warengonzaga avatar May 09 '19 19:05 warengonzaga

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 avatar May 14 '19 23:05 eltonmesquita

@eltonmesquita awesome feedback thanks for the response.

warengonzaga avatar May 15 '19 03:05 warengonzaga

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 avatar May 16 '19 01:05 linconkusunoki

@linconkusunoki you're welcome! Expect this feature in v4.

warengonzaga avatar May 21 '19 19:05 warengonzaga

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?

eltonmesquita avatar Apr 20 '20 15:04 eltonmesquita

I agree. It would be purely an overhead on maintenance.

jabranr avatar Apr 21 '20 12:04 jabranr

Cool. All settled then, I'll close this.

Thanks for the inputs!

eltonmesquita avatar Apr 21 '20 12:04 eltonmesquita