vitalets / react-native-extended-stylesheet

Extended StyleSheets for React Native
MIT License
2.93k stars 132 forks source link

let top/right/bottom/left work with $scale #178

Open HenryDF2022 opened 1 year ago

HenryDF2022 commented 1 year ago

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch react-native-extended-stylesheet@0.12.0 for the project I'm working on.

I use $scale to build my responsive app. But, left/right/top/bottom are out of control.

Here is the diff that solved my problem:

diff --git a/node_modules/react-native-extended-stylesheet/src/replacers/scale.js b/node_modules/react-native-extended-stylesheet/src/replacers/scale.js
index 8660c18..844ac15 100644
--- a/node_modules/react-native-extended-stylesheet/src/replacers/scale.js
+++ b/node_modules/react-native-extended-stylesheet/src/replacers/scale.js
@@ -9,6 +9,10 @@ const SCALABLE_PROPS = [
   'padding',
   'fontsize',
   'radius',
+  'top',
+  'bottom',
+  'left',
+  'right',
 ];

 export default {