@bgord/design 0.9.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/axis-placements-generator.d.ts +0 -2
- package/dist/backgrounds-generator.d.ts +0 -2
- package/dist/design.cjs.development.js +169 -44
- package/dist/design.cjs.development.js.map +1 -1
- package/dist/design.cjs.production.min.js +1 -1
- package/dist/design.cjs.production.min.js.map +1 -1
- package/dist/design.esm.js +169 -44
- package/dist/design.esm.js.map +1 -1
- package/dist/displays-generator.d.ts +0 -1
- package/dist/flex-directions-generator.d.ts +1 -2
- package/dist/flex-wraps-generator.d.ts +0 -2
- package/dist/font-colors-generator.d.ts +0 -2
- package/dist/font-size-generator.d.ts +0 -2
- package/dist/font-weight-generator.d.ts +0 -2
- package/dist/generator.d.ts +2 -3
- package/dist/line-height-generator.d.ts +0 -2
- package/dist/main.css +469 -10
- package/dist/main.min.css +1 -1
- package/dist/margins-generator.d.ts +1 -1
- package/dist/paddings-generator.d.ts +1 -1
- package/dist/postions-generator.d.ts +0 -2
- package/dist/tokens.d.ts +2 -0
- package/dist/widhts-generator.d.ts +1 -2
- package/dist/z-index-generator.d.ts +0 -2
- package/package.json +1 -1
- package/src/axis-placements-generator.ts +0 -4
- package/src/backgrounds-generator.ts +0 -4
- package/src/displays-generator.ts +0 -2
- package/src/flex-directions-generator.ts +12 -5
- package/src/flex-wraps-generator.ts +0 -4
- package/src/font-colors-generator.ts +0 -4
- package/src/font-size-generator.ts +0 -4
- package/src/font-weight-generator.ts +0 -4
- package/src/generate-css.ts +6 -0
- package/src/generator.ts +2 -3
- package/src/line-height-generator.ts +0 -4
- package/src/margins-generator.ts +36 -9
- package/src/paddings-generator.ts +36 -2
- package/src/postions-generator.ts +0 -4
- package/src/tokens.ts +9 -3
- package/src/widhts-generator.ts +12 -4
- package/src/z-index-generator.ts +0 -4
package/dist/design.esm.js
CHANGED
|
@@ -845,7 +845,7 @@ var File = /*#__PURE__*/function () {
|
|
|
845
845
|
var Margins = /*#__PURE__*/function () {
|
|
846
846
|
function Margins(config) {
|
|
847
847
|
this.spacing = config.spacing;
|
|
848
|
-
this.
|
|
848
|
+
this.breakpoints = config.breakpoints;
|
|
849
849
|
}
|
|
850
850
|
|
|
851
851
|
var _proto = Margins.prototype;
|
|
@@ -855,55 +855,49 @@ var Margins = /*#__PURE__*/function () {
|
|
|
855
855
|
};
|
|
856
856
|
|
|
857
857
|
_proto.generateCss = function generateCss() {
|
|
858
|
-
var output = '';
|
|
858
|
+
var output = '';
|
|
859
859
|
|
|
860
860
|
for (var _i = 0, _Object$entries = Object.entries(this.spacing); _i < _Object$entries.length; _i++) {
|
|
861
861
|
var _Object$entries$_i = _Object$entries[_i],
|
|
862
862
|
key = _Object$entries$_i[0],
|
|
863
863
|
value = _Object$entries$_i[1];
|
|
864
864
|
output += "*[data-m='" + key + "'] {\n margin: " + value + ";\n}\n";
|
|
865
|
-
}
|
|
866
|
-
|
|
865
|
+
}
|
|
867
866
|
|
|
868
867
|
for (var _i2 = 0, _Object$entries2 = Object.entries(this.spacing); _i2 < _Object$entries2.length; _i2++) {
|
|
869
868
|
var _Object$entries2$_i = _Object$entries2[_i2],
|
|
870
869
|
_key = _Object$entries2$_i[0],
|
|
871
870
|
_value = _Object$entries2$_i[1];
|
|
872
871
|
output += "*[data-mx='" + _key + "'] {\n margin-left: " + _value + ";\n margin-right: " + _value + ";\n}\n";
|
|
873
|
-
}
|
|
874
|
-
|
|
872
|
+
}
|
|
875
873
|
|
|
876
874
|
for (var _i3 = 0, _Object$entries3 = Object.entries(this.spacing); _i3 < _Object$entries3.length; _i3++) {
|
|
877
875
|
var _Object$entries3$_i = _Object$entries3[_i3],
|
|
878
876
|
_key2 = _Object$entries3$_i[0],
|
|
879
877
|
_value2 = _Object$entries3$_i[1];
|
|
880
878
|
output += "*[data-my='" + _key2 + "'] {\n margin-top: " + _value2 + ";\n margin-bottom: " + _value2 + ";\n}\n";
|
|
881
|
-
}
|
|
882
|
-
|
|
879
|
+
}
|
|
883
880
|
|
|
884
881
|
for (var _i4 = 0, _Object$entries4 = Object.entries(this.spacing); _i4 < _Object$entries4.length; _i4++) {
|
|
885
882
|
var _Object$entries4$_i = _Object$entries4[_i4],
|
|
886
883
|
_key3 = _Object$entries4$_i[0],
|
|
887
884
|
_value3 = _Object$entries4$_i[1];
|
|
888
885
|
output += "*[data-mt='" + _key3 + "'] {\n margin-top: " + _value3 + ";\n}\n";
|
|
889
|
-
}
|
|
890
|
-
|
|
886
|
+
}
|
|
891
887
|
|
|
892
888
|
for (var _i5 = 0, _Object$entries5 = Object.entries(this.spacing); _i5 < _Object$entries5.length; _i5++) {
|
|
893
889
|
var _Object$entries5$_i = _Object$entries5[_i5],
|
|
894
890
|
_key4 = _Object$entries5$_i[0],
|
|
895
891
|
_value4 = _Object$entries5$_i[1];
|
|
896
892
|
output += "*[data-mr='" + _key4 + "'] {\n margin-right: " + _value4 + ";\n}\n";
|
|
897
|
-
}
|
|
898
|
-
|
|
893
|
+
}
|
|
899
894
|
|
|
900
895
|
for (var _i6 = 0, _Object$entries6 = Object.entries(this.spacing); _i6 < _Object$entries6.length; _i6++) {
|
|
901
896
|
var _Object$entries6$_i = _Object$entries6[_i6],
|
|
902
897
|
_key5 = _Object$entries6$_i[0],
|
|
903
898
|
_value5 = _Object$entries6$_i[1];
|
|
904
899
|
output += "*[data-mb='" + _key5 + "'] {\n margin-bottom: " + _value5 + ";\n}\n";
|
|
905
|
-
}
|
|
906
|
-
|
|
900
|
+
}
|
|
907
901
|
|
|
908
902
|
for (var _i7 = 0, _Object$entries7 = Object.entries(this.spacing); _i7 < _Object$entries7.length; _i7++) {
|
|
909
903
|
var _Object$entries7$_i = _Object$entries7[_i7],
|
|
@@ -912,6 +906,64 @@ var Margins = /*#__PURE__*/function () {
|
|
|
912
906
|
output += "*[data-ml='" + _key6 + "'] {\n margin-left: " + _value6 + ";\n}\n";
|
|
913
907
|
}
|
|
914
908
|
|
|
909
|
+
for (var _i8 = 0, _Object$entries8 = Object.entries(this.breakpoints); _i8 < _Object$entries8.length; _i8++) {
|
|
910
|
+
var _Object$entries8$_i = _Object$entries8[_i8],
|
|
911
|
+
name = _Object$entries8$_i[0],
|
|
912
|
+
_value7 = _Object$entries8$_i[1];
|
|
913
|
+
output += "@media (max-width: " + _value7 + "px) {\n";
|
|
914
|
+
|
|
915
|
+
for (var _i9 = 0, _Object$entries9 = Object.entries(this.spacing); _i9 < _Object$entries9.length; _i9++) {
|
|
916
|
+
var _Object$entries9$_i = _Object$entries9[_i9],
|
|
917
|
+
_key7 = _Object$entries9$_i[0],
|
|
918
|
+
_value8 = _Object$entries9$_i[1];
|
|
919
|
+
output += " *[data-" + name + "-m='" + _key7 + "'] {\n margin: " + _value8 + ";\n }\n";
|
|
920
|
+
}
|
|
921
|
+
|
|
922
|
+
for (var _i10 = 0, _Object$entries10 = Object.entries(this.spacing); _i10 < _Object$entries10.length; _i10++) {
|
|
923
|
+
var _Object$entries10$_i = _Object$entries10[_i10],
|
|
924
|
+
_key8 = _Object$entries10$_i[0],
|
|
925
|
+
_value9 = _Object$entries10$_i[1];
|
|
926
|
+
output += " *[data-" + name + "-mx='" + _key8 + "'] {\n margin-left: " + _value9 + ";\n margin-right: " + _value9 + ";\n }\n";
|
|
927
|
+
}
|
|
928
|
+
|
|
929
|
+
for (var _i11 = 0, _Object$entries11 = Object.entries(this.spacing); _i11 < _Object$entries11.length; _i11++) {
|
|
930
|
+
var _Object$entries11$_i = _Object$entries11[_i11],
|
|
931
|
+
_key9 = _Object$entries11$_i[0],
|
|
932
|
+
_value10 = _Object$entries11$_i[1];
|
|
933
|
+
output += " *[data-" + name + "-my='" + _key9 + "'] {\n margin-top: " + _value10 + ";\n margin-bottom: " + _value10 + ";\n }\n";
|
|
934
|
+
}
|
|
935
|
+
|
|
936
|
+
for (var _i12 = 0, _Object$entries12 = Object.entries(this.spacing); _i12 < _Object$entries12.length; _i12++) {
|
|
937
|
+
var _Object$entries12$_i = _Object$entries12[_i12],
|
|
938
|
+
_key10 = _Object$entries12$_i[0],
|
|
939
|
+
_value11 = _Object$entries12$_i[1];
|
|
940
|
+
output += " *[data-" + name + "-mt='" + _key10 + "'] {\n margin-top: " + _value11 + ";\n }\n";
|
|
941
|
+
}
|
|
942
|
+
|
|
943
|
+
for (var _i13 = 0, _Object$entries13 = Object.entries(this.spacing); _i13 < _Object$entries13.length; _i13++) {
|
|
944
|
+
var _Object$entries13$_i = _Object$entries13[_i13],
|
|
945
|
+
_key11 = _Object$entries13$_i[0],
|
|
946
|
+
_value12 = _Object$entries13$_i[1];
|
|
947
|
+
output += " *[data-" + name + "-mr='" + _key11 + "'] {\n margin-right: " + _value12 + ";\n }\n";
|
|
948
|
+
}
|
|
949
|
+
|
|
950
|
+
for (var _i14 = 0, _Object$entries14 = Object.entries(this.spacing); _i14 < _Object$entries14.length; _i14++) {
|
|
951
|
+
var _Object$entries14$_i = _Object$entries14[_i14],
|
|
952
|
+
_key12 = _Object$entries14$_i[0],
|
|
953
|
+
_value13 = _Object$entries14$_i[1];
|
|
954
|
+
output += " *[data-" + name + "-mb='" + _key12 + "'] {\n margin-bottom: " + _value13 + ";\n }\n";
|
|
955
|
+
}
|
|
956
|
+
|
|
957
|
+
for (var _i15 = 0, _Object$entries15 = Object.entries(this.spacing); _i15 < _Object$entries15.length; _i15++) {
|
|
958
|
+
var _Object$entries15$_i = _Object$entries15[_i15],
|
|
959
|
+
_key13 = _Object$entries15$_i[0],
|
|
960
|
+
_value14 = _Object$entries15$_i[1];
|
|
961
|
+
output += " *[data-" + name + "-ml='" + _key13 + "'] {\n margin-left: " + _value14 + ";\n }\n";
|
|
962
|
+
}
|
|
963
|
+
|
|
964
|
+
output += "}\n";
|
|
965
|
+
}
|
|
966
|
+
|
|
915
967
|
return output;
|
|
916
968
|
};
|
|
917
969
|
|
|
@@ -925,7 +977,7 @@ var Margins = /*#__PURE__*/function () {
|
|
|
925
977
|
var Paddings = /*#__PURE__*/function () {
|
|
926
978
|
function Paddings(config) {
|
|
927
979
|
this.spacing = config.spacing;
|
|
928
|
-
this.
|
|
980
|
+
this.breakpoints = config.breakpoints;
|
|
929
981
|
}
|
|
930
982
|
|
|
931
983
|
var _proto = Paddings.prototype;
|
|
@@ -992,6 +1044,64 @@ var Paddings = /*#__PURE__*/function () {
|
|
|
992
1044
|
output += "*[data-pl='" + _key6 + "'] {\n padding-left: " + _value6 + ";\n}\n";
|
|
993
1045
|
}
|
|
994
1046
|
|
|
1047
|
+
for (var _i8 = 0, _Object$entries8 = Object.entries(this.breakpoints); _i8 < _Object$entries8.length; _i8++) {
|
|
1048
|
+
var _Object$entries8$_i = _Object$entries8[_i8],
|
|
1049
|
+
name = _Object$entries8$_i[0],
|
|
1050
|
+
_value7 = _Object$entries8$_i[1];
|
|
1051
|
+
output += "@media (max-width: " + _value7 + "px) {\n";
|
|
1052
|
+
|
|
1053
|
+
for (var _i9 = 0, _Object$entries9 = Object.entries(this.spacing); _i9 < _Object$entries9.length; _i9++) {
|
|
1054
|
+
var _Object$entries9$_i = _Object$entries9[_i9],
|
|
1055
|
+
_key7 = _Object$entries9$_i[0],
|
|
1056
|
+
_value8 = _Object$entries9$_i[1];
|
|
1057
|
+
output += " *[data-" + name + "-p='" + _key7 + "'] {\n padding: " + _value8 + ";\n }\n";
|
|
1058
|
+
}
|
|
1059
|
+
|
|
1060
|
+
for (var _i10 = 0, _Object$entries10 = Object.entries(this.spacing); _i10 < _Object$entries10.length; _i10++) {
|
|
1061
|
+
var _Object$entries10$_i = _Object$entries10[_i10],
|
|
1062
|
+
_key8 = _Object$entries10$_i[0],
|
|
1063
|
+
_value9 = _Object$entries10$_i[1];
|
|
1064
|
+
output += " *[data-" + name + "-px='" + _key8 + "'] {\n padding-left: " + _value9 + ";\n padding-right: " + _value9 + ";\n }\n";
|
|
1065
|
+
}
|
|
1066
|
+
|
|
1067
|
+
for (var _i11 = 0, _Object$entries11 = Object.entries(this.spacing); _i11 < _Object$entries11.length; _i11++) {
|
|
1068
|
+
var _Object$entries11$_i = _Object$entries11[_i11],
|
|
1069
|
+
_key9 = _Object$entries11$_i[0],
|
|
1070
|
+
_value10 = _Object$entries11$_i[1];
|
|
1071
|
+
output += " *[data-" + name + "-py='" + _key9 + "'] {\n padding-top: " + _value10 + ";\n padding-bottom: " + _value10 + ";\n }\n";
|
|
1072
|
+
}
|
|
1073
|
+
|
|
1074
|
+
for (var _i12 = 0, _Object$entries12 = Object.entries(this.spacing); _i12 < _Object$entries12.length; _i12++) {
|
|
1075
|
+
var _Object$entries12$_i = _Object$entries12[_i12],
|
|
1076
|
+
_key10 = _Object$entries12$_i[0],
|
|
1077
|
+
_value11 = _Object$entries12$_i[1];
|
|
1078
|
+
output += " *[data-" + name + "-pt='" + _key10 + "'] {\n padding-top: " + _value11 + ";\n }\n";
|
|
1079
|
+
}
|
|
1080
|
+
|
|
1081
|
+
for (var _i13 = 0, _Object$entries13 = Object.entries(this.spacing); _i13 < _Object$entries13.length; _i13++) {
|
|
1082
|
+
var _Object$entries13$_i = _Object$entries13[_i13],
|
|
1083
|
+
_key11 = _Object$entries13$_i[0],
|
|
1084
|
+
_value12 = _Object$entries13$_i[1];
|
|
1085
|
+
output += " *[data-" + name + "-pr='" + _key11 + "'] {\n padding-right: " + _value12 + ";\n }\n";
|
|
1086
|
+
}
|
|
1087
|
+
|
|
1088
|
+
for (var _i14 = 0, _Object$entries14 = Object.entries(this.spacing); _i14 < _Object$entries14.length; _i14++) {
|
|
1089
|
+
var _Object$entries14$_i = _Object$entries14[_i14],
|
|
1090
|
+
_key12 = _Object$entries14$_i[0],
|
|
1091
|
+
_value13 = _Object$entries14$_i[1];
|
|
1092
|
+
output += " *[data-" + name + "-pb='" + _key12 + "'] {\n padding-bottom: " + _value13 + ";\n }\n";
|
|
1093
|
+
}
|
|
1094
|
+
|
|
1095
|
+
for (var _i15 = 0, _Object$entries15 = Object.entries(this.spacing); _i15 < _Object$entries15.length; _i15++) {
|
|
1096
|
+
var _Object$entries15$_i = _Object$entries15[_i15],
|
|
1097
|
+
_key13 = _Object$entries15$_i[0],
|
|
1098
|
+
_value14 = _Object$entries15$_i[1];
|
|
1099
|
+
output += " *[data-" + name + "-pl='" + _key13 + "'] {\n padding-left: " + _value14 + ";\n }\n";
|
|
1100
|
+
}
|
|
1101
|
+
|
|
1102
|
+
output += "}\n";
|
|
1103
|
+
}
|
|
1104
|
+
|
|
995
1105
|
return output;
|
|
996
1106
|
};
|
|
997
1107
|
|
|
@@ -1004,7 +1114,6 @@ var Paddings = /*#__PURE__*/function () {
|
|
|
1004
1114
|
|
|
1005
1115
|
var DisplaysGenerator = /*#__PURE__*/function () {
|
|
1006
1116
|
function DisplaysGenerator(config) {
|
|
1007
|
-
this.spacing = config.spacing;
|
|
1008
1117
|
this.displays = config.displays;
|
|
1009
1118
|
}
|
|
1010
1119
|
|
|
@@ -1041,8 +1150,6 @@ var DisplaysGenerator = /*#__PURE__*/function () {
|
|
|
1041
1150
|
|
|
1042
1151
|
var AxisPlacementsGenerator = /*#__PURE__*/function () {
|
|
1043
1152
|
function AxisPlacementsGenerator(config) {
|
|
1044
|
-
this.spacing = config.spacing;
|
|
1045
|
-
this.displays = config.displays;
|
|
1046
1153
|
this.axisPlacements = config.axisPlacements;
|
|
1047
1154
|
}
|
|
1048
1155
|
|
|
@@ -1082,8 +1189,6 @@ var AxisPlacementsGenerator = /*#__PURE__*/function () {
|
|
|
1082
1189
|
|
|
1083
1190
|
var PositionsGenerator = /*#__PURE__*/function () {
|
|
1084
1191
|
function PositionsGenerator(config) {
|
|
1085
|
-
this.spacing = config.spacing;
|
|
1086
|
-
this.displays = config.displays;
|
|
1087
1192
|
this.positions = config.positions;
|
|
1088
1193
|
}
|
|
1089
1194
|
|
|
@@ -1115,8 +1220,6 @@ var PositionsGenerator = /*#__PURE__*/function () {
|
|
|
1115
1220
|
|
|
1116
1221
|
var FlexWrapGenerator = /*#__PURE__*/function () {
|
|
1117
1222
|
function FlexWrapGenerator(config) {
|
|
1118
|
-
this.spacing = config.spacing;
|
|
1119
|
-
this.displays = config.displays;
|
|
1120
1223
|
this.flexWraps = config.flexWraps;
|
|
1121
1224
|
}
|
|
1122
1225
|
|
|
@@ -1148,8 +1251,6 @@ var FlexWrapGenerator = /*#__PURE__*/function () {
|
|
|
1148
1251
|
|
|
1149
1252
|
var ZIndexGenerator = /*#__PURE__*/function () {
|
|
1150
1253
|
function ZIndexGenerator(config) {
|
|
1151
|
-
this.spacing = config.spacing;
|
|
1152
|
-
this.displays = config.displays;
|
|
1153
1254
|
this.zIndexes = config.zIndexes;
|
|
1154
1255
|
}
|
|
1155
1256
|
|
|
@@ -1181,9 +1282,8 @@ var ZIndexGenerator = /*#__PURE__*/function () {
|
|
|
1181
1282
|
|
|
1182
1283
|
var WidthsGenerator = /*#__PURE__*/function () {
|
|
1183
1284
|
function WidthsGenerator(config) {
|
|
1184
|
-
this.spacing = config.spacing;
|
|
1185
|
-
this.displays = config.displays;
|
|
1186
1285
|
this.widhts = config.widths;
|
|
1286
|
+
this.breakpoints = config.breakpoints;
|
|
1187
1287
|
}
|
|
1188
1288
|
|
|
1189
1289
|
var _proto = WidthsGenerator.prototype;
|
|
@@ -1202,6 +1302,22 @@ var WidthsGenerator = /*#__PURE__*/function () {
|
|
|
1202
1302
|
output += "*[data-width='" + key + "'] {\n width: " + value + ";\n}\n";
|
|
1203
1303
|
}
|
|
1204
1304
|
|
|
1305
|
+
for (var _i2 = 0, _Object$entries2 = Object.entries(this.breakpoints); _i2 < _Object$entries2.length; _i2++) {
|
|
1306
|
+
var _Object$entries2$_i = _Object$entries2[_i2],
|
|
1307
|
+
name = _Object$entries2$_i[0],
|
|
1308
|
+
_value = _Object$entries2$_i[1];
|
|
1309
|
+
output += "@media (max-width: " + _value + "px) {\n";
|
|
1310
|
+
|
|
1311
|
+
for (var _i3 = 0, _Object$entries3 = Object.entries(this.widhts); _i3 < _Object$entries3.length; _i3++) {
|
|
1312
|
+
var _Object$entries3$_i = _Object$entries3[_i3],
|
|
1313
|
+
_key = _Object$entries3$_i[0],
|
|
1314
|
+
_value2 = _Object$entries3$_i[1];
|
|
1315
|
+
output += " *[data-" + name + "-width='" + _key + "'] {\n width: " + _value2 + ";\n }\n";
|
|
1316
|
+
}
|
|
1317
|
+
|
|
1318
|
+
output += "}\n";
|
|
1319
|
+
}
|
|
1320
|
+
|
|
1205
1321
|
return output;
|
|
1206
1322
|
};
|
|
1207
1323
|
|
|
@@ -1214,8 +1330,6 @@ var WidthsGenerator = /*#__PURE__*/function () {
|
|
|
1214
1330
|
|
|
1215
1331
|
var FontSizeGenerator = /*#__PURE__*/function () {
|
|
1216
1332
|
function FontSizeGenerator(config) {
|
|
1217
|
-
this.spacing = config.spacing;
|
|
1218
|
-
this.displays = config.displays;
|
|
1219
1333
|
this.fontSizes = config.fontSizes;
|
|
1220
1334
|
}
|
|
1221
1335
|
|
|
@@ -1247,8 +1361,6 @@ var FontSizeGenerator = /*#__PURE__*/function () {
|
|
|
1247
1361
|
|
|
1248
1362
|
var FontWeightGenerator = /*#__PURE__*/function () {
|
|
1249
1363
|
function FontWeightGenerator(config) {
|
|
1250
|
-
this.spacing = config.spacing;
|
|
1251
|
-
this.displays = config.displays;
|
|
1252
1364
|
this.fontWeights = config.fontWeights;
|
|
1253
1365
|
}
|
|
1254
1366
|
|
|
@@ -1280,8 +1392,6 @@ var FontWeightGenerator = /*#__PURE__*/function () {
|
|
|
1280
1392
|
|
|
1281
1393
|
var LineHeightsGenerator = /*#__PURE__*/function () {
|
|
1282
1394
|
function LineHeightsGenerator(config) {
|
|
1283
|
-
this.spacing = config.spacing;
|
|
1284
|
-
this.displays = config.displays;
|
|
1285
1395
|
this.lineHeights = config.lineHeights;
|
|
1286
1396
|
}
|
|
1287
1397
|
|
|
@@ -1313,9 +1423,8 @@ var LineHeightsGenerator = /*#__PURE__*/function () {
|
|
|
1313
1423
|
|
|
1314
1424
|
var FlexDirectionsGenerator = /*#__PURE__*/function () {
|
|
1315
1425
|
function FlexDirectionsGenerator(config) {
|
|
1316
|
-
this.spacing = config.spacing;
|
|
1317
|
-
this.displays = config.displays;
|
|
1318
1426
|
this.flexDirections = config.flexDirections;
|
|
1427
|
+
this.breakpoints = config.breakpoints;
|
|
1319
1428
|
}
|
|
1320
1429
|
|
|
1321
1430
|
var _proto = FlexDirectionsGenerator.prototype;
|
|
@@ -1325,7 +1434,7 @@ var FlexDirectionsGenerator = /*#__PURE__*/function () {
|
|
|
1325
1434
|
};
|
|
1326
1435
|
|
|
1327
1436
|
_proto.generateCss = function generateCss() {
|
|
1328
|
-
var output = '';
|
|
1437
|
+
var output = '';
|
|
1329
1438
|
|
|
1330
1439
|
for (var _i = 0, _Object$entries = Object.entries(this.flexDirections); _i < _Object$entries.length; _i++) {
|
|
1331
1440
|
var _Object$entries$_i = _Object$entries[_i],
|
|
@@ -1334,6 +1443,22 @@ var FlexDirectionsGenerator = /*#__PURE__*/function () {
|
|
|
1334
1443
|
output += "*[data-direction='" + key + "'] {\n flex-direction: " + value + ";\n}\n";
|
|
1335
1444
|
}
|
|
1336
1445
|
|
|
1446
|
+
for (var _i2 = 0, _Object$entries2 = Object.entries(this.breakpoints); _i2 < _Object$entries2.length; _i2++) {
|
|
1447
|
+
var _Object$entries2$_i = _Object$entries2[_i2],
|
|
1448
|
+
name = _Object$entries2$_i[0],
|
|
1449
|
+
_value = _Object$entries2$_i[1];
|
|
1450
|
+
output += "@media (max-width: " + _value + "px) {\n";
|
|
1451
|
+
|
|
1452
|
+
for (var _i3 = 0, _Object$entries3 = Object.entries(this.flexDirections); _i3 < _Object$entries3.length; _i3++) {
|
|
1453
|
+
var _Object$entries3$_i = _Object$entries3[_i3],
|
|
1454
|
+
_key = _Object$entries3$_i[0],
|
|
1455
|
+
_value2 = _Object$entries3$_i[1];
|
|
1456
|
+
output += " *[data-" + name + "-direction='" + _key + "'] {\n flex-direction: " + _value2 + ";\n }\n";
|
|
1457
|
+
}
|
|
1458
|
+
|
|
1459
|
+
output += "}\n";
|
|
1460
|
+
}
|
|
1461
|
+
|
|
1337
1462
|
return output;
|
|
1338
1463
|
};
|
|
1339
1464
|
|
|
@@ -1346,8 +1471,6 @@ var FlexDirectionsGenerator = /*#__PURE__*/function () {
|
|
|
1346
1471
|
|
|
1347
1472
|
var BackgroundsGenerator = /*#__PURE__*/function () {
|
|
1348
1473
|
function BackgroundsGenerator(config) {
|
|
1349
|
-
this.spacing = config.spacing;
|
|
1350
|
-
this.displays = config.displays;
|
|
1351
1474
|
this.colors = config.colors;
|
|
1352
1475
|
}
|
|
1353
1476
|
|
|
@@ -1379,8 +1502,6 @@ var BackgroundsGenerator = /*#__PURE__*/function () {
|
|
|
1379
1502
|
|
|
1380
1503
|
var FontColorsGenerator = /*#__PURE__*/function () {
|
|
1381
1504
|
function FontColorsGenerator(config) {
|
|
1382
|
-
this.spacing = config.spacing;
|
|
1383
|
-
this.displays = config.displays;
|
|
1384
1505
|
this.colors = config.colors;
|
|
1385
1506
|
}
|
|
1386
1507
|
|
|
@@ -1427,9 +1548,9 @@ var Displays = {
|
|
|
1427
1548
|
'inline-block': 'inline-block'
|
|
1428
1549
|
};
|
|
1429
1550
|
var AxisPlacements = {
|
|
1430
|
-
start: 'start',
|
|
1431
|
-
end: 'end',
|
|
1432
|
-
between: 'between',
|
|
1551
|
+
start: 'flex-start',
|
|
1552
|
+
end: 'flex-end',
|
|
1553
|
+
between: 'space-between',
|
|
1433
1554
|
center: 'center',
|
|
1434
1555
|
baseline: 'baseline'
|
|
1435
1556
|
};
|
|
@@ -1500,6 +1621,9 @@ var Colors = {
|
|
|
1500
1621
|
'gray-800': '#1F2937',
|
|
1501
1622
|
black: '#111827'
|
|
1502
1623
|
};
|
|
1624
|
+
var Breakpoints = {
|
|
1625
|
+
md: 768
|
|
1626
|
+
};
|
|
1503
1627
|
|
|
1504
1628
|
var GeneratorProcessor = /*#__PURE__*/function () {
|
|
1505
1629
|
function GeneratorProcessor() {}
|
|
@@ -1514,7 +1638,7 @@ var GeneratorProcessor = /*#__PURE__*/function () {
|
|
|
1514
1638
|
while (1) {
|
|
1515
1639
|
switch (_context.prev = _context.next) {
|
|
1516
1640
|
case 0:
|
|
1517
|
-
output = "\n/* General */\n\n* {\n box-sizing: border-box;\n line-height: 24px;\n padding: 0;\n margin: 0;\n}\n\n";
|
|
1641
|
+
output = "\n/* General */\n\n* {\n box-sizing: border-box;\n line-height: 24px;\n padding: 0;\n margin: 0;\n}\n\nsmall {\n display: block;\n}\n\n";
|
|
1518
1642
|
|
|
1519
1643
|
for (_iterator = _createForOfIteratorHelperLoose(generators); !(_step = _iterator()).done;) {
|
|
1520
1644
|
generator = _step.value;
|
|
@@ -1568,7 +1692,8 @@ function _main() {
|
|
|
1568
1692
|
fontWeights: FontWeights,
|
|
1569
1693
|
lineHeights: LineHeights,
|
|
1570
1694
|
flexDirections: FlexDirections,
|
|
1571
|
-
colors: Colors
|
|
1695
|
+
colors: Colors,
|
|
1696
|
+
breakpoints: Breakpoints
|
|
1572
1697
|
};
|
|
1573
1698
|
_context2.next = 3;
|
|
1574
1699
|
return new GeneratorProcessor().process([new Margins(config), new Paddings(config), new DisplaysGenerator(config), new AxisPlacementsGenerator(config), new FlexWrapGenerator(config), new FlexDirectionsGenerator(config), new WidthsGenerator(config), new PositionsGenerator(config), new ZIndexGenerator(config), new FontSizeGenerator(config), new FontWeightGenerator(config), new FontColorsGenerator(config), new LineHeightsGenerator(config), new BackgroundsGenerator(config)]);
|