0.1.0 • Published 8 years ago
@divyagnan/rn-style-utils v0.1.0
@divyagnan/rn-style-utils
Simple style helpers to make react native prototyping easier
Example Usage
// import the helpers that you want
import { m1, mb78, p50, pt56 } from "@divyagnan/rn-style-utils";
// use the helpers
// you can use the helpers directly
<Text style={m1}>This text will have a margin of 1</Text>;
<Text style={[mb78, pt56]}>
This text will have a marginBottom of 78 and a paddingTop of 56
</Text>;
// or you can use them with StyleSheet
const styles = StyleSheet.create({
coolNewStyle: {
// this style will have a padding of 50
...p50
}
});Available Helpers
This library exports the following helpers:
Margin
m[1-100]- used to apply amarginbetween 1 and 100- ex:
m5sets a margin of 5
- ex:
mt[1-100]- used to apply amarginTopbetween 1 and 100- ex:
mt22sets a marginTop of 22
- ex:
mb[1-100]- used to apply amarginBottombetween 1 and 100- ex:
mb88sets a marginBottom of 88
- ex:
mr[1-100]- used to apply amarginRightbetween 1 and 100- ex:
mr2sets a marginRight of 2
- ex:
ml[1-100]- used to apply amarginLeftbetween 1 and 100- ex:
ml12sets a marginLeft of 12
- ex:
Padding
p[1-100]- used to apply apaddingbetween 1 and 100- ex:
p5sets a padding of 5
- ex:
pt[1-100]- used to apply apaddingTopbetween 1 and 100- ex:
pt22sets a paddingTop of 22
- ex:
pb[1-100]- used to apply apaddingBottombetween 1 and 100- ex:
pb88sets a paddingBottom of 88
- ex:
pr[1-100]- used to apply apaddingRightbetween 1 and 100- ex:
pr2sets a paddingRight of 2
- ex:
pl[1-100]- used to apply apaddingLeftbetween 1 and 100- ex:
pl12sets a paddingLeft of 12
- ex:
0.1.0
8 years ago