Thank you for your interest in contributing to React Native Common Style! This document provides guidelines and information for contributors.
- Fork the repository
- Clone your fork:
git clone https://github.com/sparth19/react-native-common-style.git - Install dependencies:
npm install - Create a feature branch:
git checkout -b feature/your-feature-name
- Node.js >= 14.0.0
- npm or yarn
- TypeScript knowledge
npm run build- Build the TypeScript files to JavaScriptnpm run clean- Remove the dist foldernpm test- Run tests (when implemented)
- Use TypeScript for all new code
- Follow the existing naming conventions
- Add JSDoc comments for new functions
- Keep utility functions pure and focused
- Add use case comments for style utilities
When adding new style utilities:
- Choose the right file: Add styles to the appropriate module (spacing, typography, flex, etc.)
- Follow naming conventions: Use camelCase for style names
- Add comments: Include use case examples in comments
- Consider responsiveness: Use the Metrics system for responsive values
- Test cross-platform: Ensure compatibility with both iOS and Android
// In spacing.ts
export const spacing = {
// ... existing styles
// New utility for specific use case
sectionGap: responsiveSize(32), // Large gap between sections
};Before submitting a pull request:
- Run the build:
npm run build - Test in a React Native project
- Ensure TypeScript compilation works
- Verify cross-platform compatibility
- Commit your changes with clear commit messages
- Push to your fork
- Create a pull request with:
- Clear description of changes
- Any breaking changes noted
- Examples of usage if adding new features
- Title: Clear, descriptive title
- Description: Explain what and why, not how
- Breaking Changes: Clearly mark any breaking changes
- Examples: Include usage examples for new features
- Tests: Add tests if applicable
- Be respectful and inclusive
- Focus on constructive feedback
- Help others learn and grow
If you have questions about contributing, please open an issue or reach out to the maintainers.
Thank you for contributing! 🚀