react-native-scaled-sheet
Version:
A React Native interceptor for StyleSheet to scale sizes based in screen dimensions.
1 lines • 651 B
JavaScript
Object.defineProperty(exports,"__esModule",{value:true});exports.scaleStyles=void 0;var _index=require("./index");var scaleStyles=function scaleStyles(styles,baseWidth,dimensions){var scaledStyles={};for(var key in styles){if((0,_index.hasProperty)(styles,key)){var style=styles[key];scaledStyles[key]=style;for(var prop in style){if((0,_index.hasProperty)(style,prop)){var value=style[prop];if((0,_index.isNumber)(value)&&(0,_index.notFlexProperty)(prop)){scaledStyles[key][prop]=!(0,_index.hasFontProperty)(prop)?(0,_index.scaleSize)(value,baseWidth,dimensions):(0,_index.scaleFont)(value);}}}}}return scaledStyles;};exports.scaleStyles=scaleStyles;