Skip to content

Failed to execute 'animate' on 'Element': 'tw-k' is not a valid value for easing #21

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

Closed
MarvinMiles opened this issue Jun 6, 2023 · 2 comments

Comments

@MarvinMiles
Copy link

MarvinMiles commented Jun 6, 2023

Hey!
Thank you for your amazing job. Works almost perfect out of box without any configured options.

I'm using Vite/Vue and my first issue is:

Input:
Screen Shot 2023-06-07 at 01 54 41

Bundled output:
Screen Shot 2023-06-07 at 01 57 55

This causing an issue:
Screen Shot 2023-06-07 at 02 10 31

Moreover, setting "ignoreClass" option in "classGenerator" has no effect. Is it WIP?

sonofmagic added a commit that referenced this issue Jun 7, 2023
@sonofmagic
Copy link
Owner

sonofmagic commented Jun 7, 2023

Hello, the reason for this problem is that ease-out is also one of the class keywords generated by tailwindcss.

F.Y.I: https://tailwindcss.com/docs/transition-timing-function

so you can do this steps to fix this issue.

1: Upgrade to unplugin-tailwindcss-mangle@^1.2.3

Then add some class not to be mangled

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { vitePlugin as utwm, defaultMangleClassFilter } from 'unplugin-tailwindcss-mangle'
// https://vitejs.dev/config/
export default defineConfig({
  plugins: [
    vue(),
    utwm({
      mangleClassFilter(className) {
        if (['ease-out', 'ease-linear', 'ease-in', 'ease-in-out'].includes(className)) {
          return false
        }
        return defaultMangleClassFilter(className)
      },
    })
  ]
})

@MarvinMiles
Copy link
Author

It works now. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants