Thank you for your interest in contributing to the Tailwind Motion plugin! We welcome contributions from the community to help make this plugin even better.
The plugin is organized into modular files for easy maintenance and extensibility:
src/
├── animations/
│ ├── fade.js - Fade animations
│ ├── slide.js - Slide animations
│ ├── bounce.js - Bounce animations
│ └── rotate.js - Rotation animations
└── utils.js - Common utilities (duration, timing, etc.)
- Create a new file in
src/animations/
following this structure:
module.exports = {
keyframes: {
'animation-name': {
'0%': { /* initial state */ },
'50%': { /* intermediate state (optional) */ },
'100%': { /* final state */ },
},
// Add more keyframes as needed
},
utilities: {
'.animate-name': {
animation: 'animation-name 0.5s ease-out',
},
// Add more utilities as needed
},
}
- Import your animation file in
index.js
:
const newAnimations = require('./src/animations/your-animation')
// Add to allKeyframes
const allKeyframes = {
...fadeAnimations.keyframes,
...newAnimations.keyframes, // Add your keyframes
}
// Add to utilities
addUtilities({
...fadeAnimations.utilities,
...newAnimations.utilities, // Add your utilities
})
- Use descriptive, hyphen-separated names for animations (e.g., 'fade-in', 'slide-up')
- Prefix utility classes with 'animate-' (e.g., '.animate-fade-in')
- Use clear, descriptive names that indicate the animation's purpose
- Prefer transform and opacity animations for better performance
- Avoid animating layout properties (width, height, padding, margin)
- Keep animations simple and efficient
- Test animations on low-end devices
- Consider reducing animation complexity for mobile devices
- Test animations in multiple browsers
- Provide fallbacks for older browsers when necessary
- Use standard CSS properties when possible
- Document any browser-specific limitations
- Fork the repository
- Create a feature branch:
git checkout -b feature/new-animation-type
- Install dependencies:
npm install
-
Make your changes:
- Add new animation files
- Update existing animations
- Add tests if applicable
- Update documentation
-
Test your changes:
- Test with different Tailwind CSS versions
- Test in different browsers
- Test with different screen sizes
- Verify all existing animations still work
-
Commit your changes:
git add .
git commit -m "feat: add new animation type"
- Push to your fork:
git push origin feature/new-animation-type
- Create a pull request
- Clearly describe the new animations or changes
- Explain the purpose and use cases
- Include examples of usage
- List any breaking changes
- Reference related issues
- Follow existing code style
- Keep changes focused and minimal
- Add comments for complex animations
- Ensure code is properly formatted
- Remove any console.logs or debugging code
- Update README.md with new animations
- Add examples of usage
- Document any new configuration options
- Update type definitions if necessary
- Add test cases for new animations
- Test with different configurations
- Verify browser compatibility
- Check performance impact
- Clone the repository:
git clone https://github.com/haikallfiqih/tailwind-motion.git
cd tailwind-motion
- Install dependencies:
npm install
- Create a test environment:
npm run dev
- Use ES6+ features when appropriate
- Follow consistent indentation (2 spaces)
- Use meaningful variable and function names
- Add JSDoc comments for functions
- Keep functions small and focused
- Use consistent naming patterns
- Keep animations performant
- Follow CSS best practices
- Document animation parameters
- Consider accessibility
- Test in major browsers
- Test on different devices
- Test with different screen sizes
- Verify animation performance
If you have questions or run into issues:
- Check existing issues first
- Create a new issue with:
- Clear description
- Steps to reproduce
- Expected vs actual behavior
- Environment details:
- Browser version
- Tailwind CSS version
- Node.js version
- Operating system
By contributing, you agree that your contributions will be licensed under the MIT License.