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

Toggle button transition not working #54

Closed
amaan-ahmad opened this issue Jan 29, 2021 · 4 comments
Closed

Toggle button transition not working #54

amaan-ahmad opened this issue Jan 29, 2021 · 4 comments

Comments

@amaan-ahmad
Copy link
Contributor

Hey contributors,

I tried fixing the transition in the toggle button, but it doesn't seem to work.

The reason is:

  • transition class name in tailwind does transition on the following properties:
    • background-color
    • border-color
    • color
    • fill
    • stroke
    • opacity
    • box-shadow
    • transform

We need to apply transition on the position because the toggle element takes checked: right-0.

It would be great if someone could figure out how to apply transition on "position" property.

Thanks,
Amaan Ahmad.

@wanacode
Copy link
Contributor

wanacode commented Feb 4, 2021

I managed to get a transition on the toggle by adding a class to set the initial position right-4 and then a transition duration e.g. duration-300.

Without an initial value for right being set, the toggle doesn't have a value to transition from, so it can't animate the element.

@amaan-ahmad
Copy link
Contributor Author

Great! If it's working then kindly do a PR. It will be reviewed by Maintainer.

@wanacode
Copy link
Contributor

wanacode commented Feb 4, 2021

Sure, I have created a PR to resolve this: #56

@Charlie85270
Copy link
Owner

Fix with : #56

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

3 participants