-
Notifications
You must be signed in to change notification settings - Fork 193
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
feat(new styles guide): Added responsive functions and common styles #7
base: master
Are you sure you want to change the base?
Conversation
Thanks again & great that you added a new Chapter 13. Will review it ASAP mate 🚀 |
Hi mate, please allow me couple of days to complete the merging. Planning to make it in upcoming weekend. Surely I will try to complete it before weekend. You did really a great work 🔥💯 |
Hey there, just relax. Thank you. I plan to add new documentation regarding styling and icon usage at the end of this month. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @khayym , you did really an amazing job by adding a Styling guide in this Book 🔥
It will really help the community. Thanks once again as the article you added really has some good knowledges.
However, I found that these changes can make it more understandable for beginners. If you have some free time please have a look. Waiting for your landing mate 🚀
FYI, I'm creating a Banner for this guide. Once all OK, I will publish it into main stream 🚀
|
||
## Implementing Styling Metrics | ||
|
||
With our foundation set, we'll define functions that help normalize dimensions based on the device's screen size. These are essential for ensuring your application's UI components are properly scaled across various devices. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please explain what means by "normalize dimensions", "Normalization Functions" or "vertical and horizontal normalization" ?
Specifically what "Normalization" means throughout this awesome guide ?
It would be really great, if you can create a "Common Terms" section in this article at the top & under that section explain what this "Normalization" means really.
|
||
Below are the styles defined in `CommonStyles`, along with their intended usage: | ||
|
||
### Flex Styles |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Establishing a solid foundation for our styling metrics is crucial for ensuring our application's UI remains consistent across various devices. Here's how we set it up: | ||
|
||
```javascript | ||
import { PixelRatio } from 'react-native'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please add a more precise relation between the first 5 code chunks on Normalizations ?
I see in this guide, the first 5 code chunks are actually indicating a same file. It would be better, if it was mentioned more precisely that these code chunks indicating a same file by using a file name. Code chunks are under these sections 👇
- The Core of Our Styling Metrics
- Normalizing Width and Height
- Font Size Adjustment
- Additional Normalization Functions
- Unified Normalization Function
🟢 It would be better really if you can do this below 2 steps 👇
-
Before the code chunk under section The Core of Our Styling Metrics you can add a text like below 👇
Let's create a file under "/src/utils/NormalizeFunctions.js" & then paste this below code in that "NormalizeFunctions.js" file.
-
Then before all other 4 code chunks (mentioned above), you can add a text like below 👇
Let's add this below code at the bottom of your "NormalizeFunctions.js"
These above 2 steps will make a more better relation between those 5 sections code chunks & it will be helpful really.
🟢 "Or" you can give the full code of Normalization Functions at the top of this article & then you can say, "Let's break each functions" & then show each part codes.
🟢 "Or" whatever step you can take to make a good relation between the first 5 code chunks please.
|
||
```javascript | ||
import { StyleSheet } from 'react-native'; | ||
import { normalize } from './yourNormalizeFunctionPath'; // Ensure to import the normalize function correctly |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please add a more specific file name. Ex: ./src/utils/NormalizeFunctions.js instead of './yourNormalizeFunctionPath' ?
It will help the readers to identify which codes were being indicated to import.
I added an another review on adding file name as ./src/utils/NormalizeFunctions.js. Could you please look at line number 20 to see the review.
Hello @khayym, are you there please to collaborate about the PR changes request ? |
@anisurrahman072 Hi, I will make update for this week) |
For a React Native application, it is best practice to use common styles and normalize functions to ensure responsive design and avoid creating multiple styles.
I added this docs about that, have a good checking )