Skip to content
This repository was archived by the owner on Dec 29, 2022. It is now read-only.

Commit e943c1b

Browse files
committed
use only width for responsiveFontSize
1 parent 038d907 commit e943c1b

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
Responsive height, width and responsive fontSize for react native components that automatically adjust themselves based on the screen size of the device. The dimensions can be used for any components like View, Image, Text etc.
44

5+
Responsive Font Size uses only the width of the device and auto adjusts to the screen. It will not depend on Height due to different aspect ratio across many devices.
6+
57
Installation
68
```sh
79
#npm

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-responsive-dimensions",
3-
"version": "1.0.2",
3+
"version": "2.0.0",
44
"description":
55
"Resposive fontSize, height and width for your react-native components.",
66
"main": "src/index.js",

src/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,5 @@ export const responsiveWidth = (w) => {
3737
};
3838

3939
export const responsiveFontSize = (f) => {
40-
return Math.sqrt((height*height)+(width*width))*(f/100);
40+
return ((16/9)*width)*(f/100);
4141
};

0 commit comments

Comments
 (0)