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

Custom prefix instead of animate__ #37

Closed
En3Tho opened this issue Dec 20, 2022 · 1 comment · Fixed by #40
Closed

Custom prefix instead of animate__ #37

En3Tho opened this issue Dec 20, 2022 · 1 comment · Fixed by #40
Labels
enhancement New feature or request

Comments

@En3Tho
Copy link
Contributor

En3Tho commented Dec 20, 2022

addUtilities(
            [
                Object.entries(utilities).map(([key, value]) => {
                    return {
// "animate__" can be a custom variable here instead with "animate__" being a default value if custom is undefined.
                        [`.${e(`animate__${key}`)}`]: value, 
                    }
                })
            ]
        )

What do you think of this idea? Tailwind usually uses '-' as delimiter and I would really like to have things being consistent to one style.
Also, can you please tell me if there was something preventing you from just using "animated", "fadeIn" etc. styles without prefix? Because I would like to have "" prefix as a valid one too.

@bentzibentz
Copy link
Owner

Hi,

i used the prefix to prevent problems if the projects contains other libraries with same class names. But i get your point to make the class names more tailwind like:

.animated-fadeIn {}

or maybe even shorter:

.ani-fadeIn {}

The option to remove the prefix at all is also a good idea, maybe we could do something like this to make it optional:

// tailwind.config.js
module.exports = {
    theme: {
        animatedSettings: {
            useAnimatedClassName: true/false,
      }
    },
}

You are welcome to make a pull request.
If not i will have a look at it as soon as possible.

@bentzibentz bentzibentz added the enhancement New feature or request label Dec 21, 2022
@En3Tho En3Tho changed the title Custom prefix instead of amimate__ Custom prefix instead of animate__ Jan 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
2 participants