{"id":23582473,"url":"https://github.com/fork/css-transition","last_synced_at":"2025-05-06T23:44:26.545Z","repository":{"id":57093717,"uuid":"177141904","full_name":"fork/css-transition","owner":"fork","description":"Apply a CSS class for each stage of a CSS transition","archived":false,"fork":false,"pushed_at":"2019-03-22T15:03:16.000Z","size":183,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-04-15T20:47:33.437Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@4rk/css-transition","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fork.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-03-22T13:07:24.000Z","updated_at":"2024-11-02T14:30:42.000Z","dependencies_parsed_at":"2022-08-22T21:40:18.982Z","dependency_job_id":null,"html_url":"https://github.com/fork/css-transition","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fork%2Fcss-transition","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fork%2Fcss-transition/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fork%2Fcss-transition/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fork%2Fcss-transition/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fork","download_url":"https://codeload.github.com/fork/css-transition/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252788404,"owners_count":21804280,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-27T01:11:41.857Z","updated_at":"2025-05-06T23:44:26.529Z","avatar_url":"https://github.com/fork.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CSSTransition\n\nApply a CSS class for each stage of a CSS transition.\n\nThis is basically a react-free rip-off of [react-transition-group](https://github.com/reactjs/react-transition-group).\n\nIt is super useful to make CSS transitions from `display: none;` to `display: whatever;`.\n\n## Demo\n\nThere is a simple usage demo which can be run as follows:\n\n    yarn\n    yarn start\n\n## Usage\n\nThe basic idea of this library is that in order to control a CSS transition using JavaScript, you have to think of it as a three-staged process:\n\n1. **Start:**\n    - Set prerequisites for the animation, e.g. set `display: block;` and `transition: all 0.3s ease;`\n1. **Active:**\n    - One `requestAnimationFrame` after start\n    - Change transitioning properties, e.g. set `opacity: 1;`\n1. **Done:**\n    - After `transitionend` or a timeout\n    - Make transition changes permanent, this means usually setting the same properties as during active stage\n    - During `exit`, this would be the place to set `display` back to `none`.\n\nFor a code example, please take a look at the demo.\n\n## Tricks\n\n-   Apply `pointer-events: none;` during `.exit` and `.exit-active` to prevent user interaction during transition\n-   How to cope with the timeout warning:\n    1. Make sure that a transition is happening on the element specified during instantiation, e.g. it is _not_ a parent element but the direct element on which the transitions are happening. If not, create separate `CSSTransition` instances for each element.\n    1. Make sure that there is actually a transition. The instance is waiting for the first `transitionend` event.\n    1. Check whether your transition takes less time than the configured timeout which is by default 500ms. If not, increase the timeout.\n\n## Creating a release\n\nCertain steps need to be done in order to create a new release:\n\n1. Decide on a [semver](https://semver.org/spec/v2.0.0.html) version number\n1. Start a new release using `git flow release start [version number]`\n1. Update the `package.json` version\n1. Run `yarn run release`\n1. Commit changes: `git commit -a -m \"Prepare release [version number]\"`\n1. Finish release using `git flow release finish`\n1. Push all changes: `git push origin --all \u0026\u0026 git push origin --tags`\n\n## License\n\nSee [LICENSE](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffork%2Fcss-transition","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffork%2Fcss-transition","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffork%2Fcss-transition/lists"}