Skip to content

Commit

Permalink
Update build dimensions
Browse files Browse the repository at this point in the history
  • Loading branch information
bombassaro committed Jan 6, 2021
1 parent 448a8ce commit 4fc4097
Showing 1 changed file with 22 additions and 17 deletions.
39 changes: 22 additions & 17 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5419,9 +5419,9 @@ var parseDimension = function parseDimension(theme, _ref) {
var height = _ref.height,
width = _ref.width;
var object = [];
var factor = 8;
isNaN(height) ? object.push("height: ".concat(height, ";")) : object.push("height: ".concat(factor * height, "px;"));
isNaN(width) ? object.push("width: ".concat(width, ";")) : object.push("width: ".concat(factor * width, "px;"));
var factor = theme.factors.dimensions;
height !== undefined && isNaN(height) ? object.push("height: ".concat(height, ";")) : object.push("height: ".concat(factor * height, "px;"));
width !== undefined && isNaN(width) ? object.push("width: ".concat(width, ";")) : object.push("width: ".concat(factor * width, "px;"));
return object.join('');
};

Expand All @@ -5440,13 +5440,13 @@ var parseMargin = function parseMargin(theme, _ref) {
mb = _ref.mb,
ml = _ref.ml;
var object = [];
var factor = 8;
isNaN(mx) ? object.push("\n margin-left: ".concat(mx, "; \n margin-right: ").concat(mx, ";")) : mx && object.push("\n margin-left: ".concat(factor * mx, "px; \n margin-right: ").concat(factor * mx, "px;\n "));
isNaN(my) ? object.push("\n margin-top: ".concat(my, "; \n margin-bottom: ").concat(my, ";")) : my && object.push("\n margin-top: ".concat(factor * my, "px; \n margin-bottom: ").concat(factor * my, "px;\n "));
isNaN(mt) ? object.push("\n margin-top: ".concat(mt, ";")) : mt && object.push("\n margin-top: ".concat(factor * mt, "px;\n "));
isNaN(mr) ? object.push("\n margin-right: ".concat(mr, ";")) : mr && object.push("\n margin-right: ".concat(factor * mr, "px;\n "));
isNaN(mb) ? object.push("\n margin-bottom: ".concat(mb, ";")) : mb && object.push("\n margin-bottom: ".concat(factor * mb, "px;\n "));
isNaN(ml) ? object.push("\n margin-left: ".concat(ml, ";")) : ml && object.push("\n margin-left: ".concat(factor * ml, "px;\n "));
var factor = theme.factors.margin;
mx !== undefined && isNaN(mx) ? object.push("\n margin-left: ".concat(mx, "; \n margin-right: ").concat(mx, ";")) : mx && object.push("\n margin-left: ".concat(factor * mx, "px; \n margin-right: ").concat(factor * mx, "px;\n "));
my !== undefined && isNaN(my) ? object.push("\n margin-top: ".concat(my, "; \n margin-bottom: ").concat(my, ";")) : my && object.push("\n margin-top: ".concat(factor * my, "px; \n margin-bottom: ").concat(factor * my, "px;\n "));
mt !== undefined && isNaN(mt) ? object.push("\n margin-top: ".concat(mt, ";")) : mt && object.push("\n margin-top: ".concat(factor * mt, "px;\n "));
mr !== undefined && isNaN(mr) ? object.push("\n margin-right: ".concat(mr, ";")) : mr && object.push("\n margin-right: ".concat(factor * mr, "px;\n "));
mb !== undefined && isNaN(mb) ? object.push("\n margin-bottom: ".concat(mb, ";")) : mb && object.push("\n margin-bottom: ".concat(factor * mb, "px;\n "));
ml !== undefined && isNaN(ml) ? object.push("\n margin-left: ".concat(ml, ";")) : ml && object.push("\n margin-left: ".concat(factor * ml, "px;\n "));
return object.join('');
};

Expand All @@ -5458,13 +5458,13 @@ var parsePadding = function parsePadding(theme, _ref) {
pb = _ref.pb,
pl = _ref.pl;
var object = [];
var factor = 8;
isNaN(px) ? object.push("\n padding-left: ".concat(px, "; \n padding-right: ").concat(px, ";\n ")) : px && object.push("\n padding-left: ".concat(factor * px, "px; \n padding-right: ").concat(factor * px, "px\n ;"));
isNaN(py) ? object.push("\n padding-top: ".concat(py, "; \n padding-bottom: ").concat(py, ";\n ")) : py && object.push("\n padding-top: ".concat(factor * py, "px; \n padding-bottom: ").concat(factor * py, "px\n ;"));
isNaN(pt) ? object.push("\n padding-top: ".concat(pt, ";\n ")) : pt && object.push("\n padding-top: ".concat(factor * pt, "px\n ;"));
isNaN(pr) ? object.push("\n padding-right: ".concat(pr, ";\n ")) : pr && object.push("\n padding-right: ".concat(factor * pr, "px\n ;"));
isNaN(pb) ? object.push("\n padding-bottom: ".concat(pb, ";\n ")) : pb && object.push("\n padding-bottom: ".concat(factor * pb, "px\n ;"));
isNaN(pl) ? object.push("\n padding-left: ".concat(pl, ";\n ")) : pl && object.push("\n padding-left: ".concat(factor * pl, "px\n ;"));
var factor = theme.factors.padding;
px !== undefined && isNaN(px) ? object.push("\n padding-left: ".concat(px, "; \n padding-right: ").concat(px, ";\n ")) : px && object.push("\n padding-left: ".concat(factor * px, "px; \n padding-right: ").concat(factor * px, "px\n ;"));
py !== undefined && isNaN(py) ? object.push("\n padding-top: ".concat(py, "; \n padding-bottom: ").concat(py, ";\n ")) : py && object.push("\n padding-top: ".concat(factor * py, "px; \n padding-bottom: ").concat(factor * py, "px\n ;"));
pt !== undefined && isNaN(pt) ? object.push("\n padding-top: ".concat(pt, ";\n ")) : pt && object.push("\n padding-top: ".concat(factor * pt, "px\n ;"));
pr !== undefined && isNaN(pr) ? object.push("\n padding-right: ".concat(pr, ";\n ")) : pr && object.push("\n padding-right: ".concat(factor * pr, "px\n ;"));
pb !== undefined && isNaN(pb) ? object.push("\n padding-bottom: ".concat(pb, ";\n ")) : pb && object.push("\n padding-bottom: ".concat(factor * pb, "px\n ;"));
pl !== undefined && isNaN(pl) ? object.push("\n padding-left: ".concat(pl, ";\n ")) : pl && object.push("\n padding-left: ".concat(factor * pl, "px\n ;"));
return object.join('');
};

Expand Down Expand Up @@ -5537,6 +5537,11 @@ var theme = {
primary: 'PT Sans',
secondary: 'Nunito Sans'
},
factors: {
dimensions: 10,
padding: 8,
margin: 8
},
parseAlign: parseAlign,
parseBgColor: parseBgColor,
parseCustom: parseCustom,
Expand Down

0 comments on commit 4fc4097

Please sign in to comment.