react-native-style-tachyons
Version:
functional, maintainable styling for react-native
42 lines (41 loc) • 975 B
JavaScript
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const lodash_1 = __importDefault(require("lodash"));
const REM_SCALE = [
0,
0.25,
0.5,
1,
2,
4,
8,
16,
32
];
const what = lodash_1.default.toPairs({
m: "margin",
p: "padding"
});
const where = lodash_1.default.toPairs({
a: "",
h: "Horizontal",
v: "Vertical",
t: "Top",
r: "Right",
b: "Bottom",
l: "Left"
});
const style = {};
lodash_1.default.forEach(what, ([whatShort, whatLong]) => {
lodash_1.default.forEach(where, ([whereShort, whereLong]) => {
lodash_1.default.forEach(REM_SCALE, (scale, idx) => {
style[`${whatShort}${whereShort}${idx}`] = {
[`${whatLong}${whereLong}`]: scale
};
});
});
});
exports.default = style;
;