@symbo.ls/scratch 2.11.228 → 2.11.234
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/cjs/factory.js +26 -26
- package/dist/cjs/index.js +41 -34
- package/dist/cjs/set.js +39 -34
- package/dist/cjs/system/color.js +26 -26
- package/dist/cjs/system/document.js +26 -26
- package/dist/cjs/system/font.js +26 -26
- package/dist/cjs/system/index.js +39 -34
- package/dist/cjs/system/reset.js +26 -26
- package/dist/cjs/system/shadow.js +34 -28
- package/dist/cjs/system/spacing.js +39 -34
- package/dist/cjs/system/svg.js +26 -26
- package/dist/cjs/system/theme.js +26 -26
- package/dist/cjs/system/timing.js +37 -31
- package/dist/cjs/system/typography.js +39 -34
- package/dist/cjs/transforms/index.js +34 -28
- package/dist/cjs/utils/color.js +26 -26
- package/dist/cjs/utils/index.js +40 -34
- package/dist/cjs/utils/sequence.js +34 -28
- package/dist/cjs/utils/sprite.js +26 -26
- package/dist/cjs/utils/unit.js +28 -0
- package/dist/cjs/utils/var.js +36 -32
- package/package.json +2 -2
- package/src/utils/index.js +1 -0
- package/src/utils/sequence.js +6 -2
- package/src/utils/unit.js +5 -0
- package/src/utils/var.js +11 -9
|
@@ -30,9 +30,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
30
30
|
));
|
|
31
31
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
32
32
|
|
|
33
|
-
//
|
|
33
|
+
// ../../node_modules/@domql/utils/dist/cjs/key.js
|
|
34
34
|
var require_key = __commonJS({
|
|
35
|
-
"
|
|
35
|
+
"../../node_modules/@domql/utils/dist/cjs/key.js"(exports, module2) {
|
|
36
36
|
"use strict";
|
|
37
37
|
var __defProp2 = Object.defineProperty;
|
|
38
38
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -69,9 +69,9 @@ var require_key = __commonJS({
|
|
|
69
69
|
}
|
|
70
70
|
});
|
|
71
71
|
|
|
72
|
-
//
|
|
72
|
+
// ../../node_modules/@domql/utils/dist/cjs/env.js
|
|
73
73
|
var require_env = __commonJS({
|
|
74
|
-
"
|
|
74
|
+
"../../node_modules/@domql/utils/dist/cjs/env.js"(exports, module2) {
|
|
75
75
|
"use strict";
|
|
76
76
|
var __defProp2 = Object.defineProperty;
|
|
77
77
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -107,9 +107,9 @@ var require_env = __commonJS({
|
|
|
107
107
|
}
|
|
108
108
|
});
|
|
109
109
|
|
|
110
|
-
//
|
|
110
|
+
// ../../node_modules/@domql/utils/dist/cjs/globals.js
|
|
111
111
|
var require_globals = __commonJS({
|
|
112
|
-
"
|
|
112
|
+
"../../node_modules/@domql/utils/dist/cjs/globals.js"(exports, module2) {
|
|
113
113
|
"use strict";
|
|
114
114
|
var __defProp2 = Object.defineProperty;
|
|
115
115
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -143,9 +143,9 @@ var require_globals = __commonJS({
|
|
|
143
143
|
}
|
|
144
144
|
});
|
|
145
145
|
|
|
146
|
-
//
|
|
146
|
+
// ../../node_modules/@domql/utils/dist/cjs/node.js
|
|
147
147
|
var require_node = __commonJS({
|
|
148
|
-
"
|
|
148
|
+
"../../node_modules/@domql/utils/dist/cjs/node.js"(exports, module2) {
|
|
149
149
|
"use strict";
|
|
150
150
|
var __defProp2 = Object.defineProperty;
|
|
151
151
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -180,9 +180,9 @@ var require_node = __commonJS({
|
|
|
180
180
|
}
|
|
181
181
|
});
|
|
182
182
|
|
|
183
|
-
//
|
|
183
|
+
// ../../node_modules/@domql/utils/dist/cjs/types.js
|
|
184
184
|
var require_types = __commonJS({
|
|
185
|
-
"
|
|
185
|
+
"../../node_modules/@domql/utils/dist/cjs/types.js"(exports, module2) {
|
|
186
186
|
"use strict";
|
|
187
187
|
var __defProp2 = Object.defineProperty;
|
|
188
188
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -270,9 +270,9 @@ var require_types = __commonJS({
|
|
|
270
270
|
}
|
|
271
271
|
});
|
|
272
272
|
|
|
273
|
-
//
|
|
273
|
+
// ../../node_modules/@domql/utils/dist/cjs/array.js
|
|
274
274
|
var require_array = __commonJS({
|
|
275
|
-
"
|
|
275
|
+
"../../node_modules/@domql/utils/dist/cjs/array.js"(exports, module2) {
|
|
276
276
|
"use strict";
|
|
277
277
|
var __defProp2 = Object.defineProperty;
|
|
278
278
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -383,9 +383,9 @@ var require_array = __commonJS({
|
|
|
383
383
|
}
|
|
384
384
|
});
|
|
385
385
|
|
|
386
|
-
//
|
|
386
|
+
// ../../node_modules/@domql/utils/dist/cjs/string.js
|
|
387
387
|
var require_string = __commonJS({
|
|
388
|
-
"
|
|
388
|
+
"../../node_modules/@domql/utils/dist/cjs/string.js"(exports, module2) {
|
|
389
389
|
"use strict";
|
|
390
390
|
var __defProp2 = Object.defineProperty;
|
|
391
391
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -443,9 +443,9 @@ var require_string = __commonJS({
|
|
|
443
443
|
}
|
|
444
444
|
});
|
|
445
445
|
|
|
446
|
-
//
|
|
446
|
+
// ../../node_modules/@domql/utils/dist/cjs/object.js
|
|
447
447
|
var require_object = __commonJS({
|
|
448
|
-
"
|
|
448
|
+
"../../node_modules/@domql/utils/dist/cjs/object.js"(exports, module2) {
|
|
449
449
|
"use strict";
|
|
450
450
|
var __defProp2 = Object.defineProperty;
|
|
451
451
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -935,9 +935,9 @@ var require_object = __commonJS({
|
|
|
935
935
|
}
|
|
936
936
|
});
|
|
937
937
|
|
|
938
|
-
//
|
|
938
|
+
// ../../node_modules/@domql/utils/dist/cjs/function.js
|
|
939
939
|
var require_function = __commonJS({
|
|
940
|
-
"
|
|
940
|
+
"../../node_modules/@domql/utils/dist/cjs/function.js"(exports, module2) {
|
|
941
941
|
"use strict";
|
|
942
942
|
var __defProp2 = Object.defineProperty;
|
|
943
943
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -1010,9 +1010,9 @@ var require_function = __commonJS({
|
|
|
1010
1010
|
}
|
|
1011
1011
|
});
|
|
1012
1012
|
|
|
1013
|
-
//
|
|
1013
|
+
// ../../node_modules/@domql/utils/dist/cjs/log.js
|
|
1014
1014
|
var require_log = __commonJS({
|
|
1015
|
-
"
|
|
1015
|
+
"../../node_modules/@domql/utils/dist/cjs/log.js"(exports, module2) {
|
|
1016
1016
|
"use strict";
|
|
1017
1017
|
var __defProp2 = Object.defineProperty;
|
|
1018
1018
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -1051,9 +1051,9 @@ var require_log = __commonJS({
|
|
|
1051
1051
|
}
|
|
1052
1052
|
});
|
|
1053
1053
|
|
|
1054
|
-
//
|
|
1054
|
+
// ../../node_modules/@domql/utils/dist/cjs/cookie.js
|
|
1055
1055
|
var require_cookie = __commonJS({
|
|
1056
|
-
"
|
|
1056
|
+
"../../node_modules/@domql/utils/dist/cjs/cookie.js"(exports, module2) {
|
|
1057
1057
|
"use strict";
|
|
1058
1058
|
var __defProp2 = Object.defineProperty;
|
|
1059
1059
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -1107,9 +1107,9 @@ var require_cookie = __commonJS({
|
|
|
1107
1107
|
}
|
|
1108
1108
|
});
|
|
1109
1109
|
|
|
1110
|
-
//
|
|
1110
|
+
// ../../node_modules/@domql/utils/dist/cjs/tags.js
|
|
1111
1111
|
var require_tags = __commonJS({
|
|
1112
|
-
"
|
|
1112
|
+
"../../node_modules/@domql/utils/dist/cjs/tags.js"(exports, module2) {
|
|
1113
1113
|
"use strict";
|
|
1114
1114
|
var __defProp2 = Object.defineProperty;
|
|
1115
1115
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -1272,9 +1272,9 @@ var require_tags = __commonJS({
|
|
|
1272
1272
|
}
|
|
1273
1273
|
});
|
|
1274
1274
|
|
|
1275
|
-
//
|
|
1275
|
+
// ../../node_modules/@domql/utils/dist/cjs/index.js
|
|
1276
1276
|
var require_cjs = __commonJS({
|
|
1277
|
-
"
|
|
1277
|
+
"../../node_modules/@domql/utils/dist/cjs/index.js"(exports, module2) {
|
|
1278
1278
|
"use strict";
|
|
1279
1279
|
var __defProp2 = Object.defineProperty;
|
|
1280
1280
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -1596,6 +1596,11 @@ var getActiveConfig = (def) => {
|
|
|
1596
1596
|
return FACTORY[def || FACTORY.active];
|
|
1597
1597
|
};
|
|
1598
1598
|
|
|
1599
|
+
// src/utils/unit.js
|
|
1600
|
+
var isScalingUnit = (unit) => {
|
|
1601
|
+
return unit === "em" || unit === "rem" || unit === "vw" || unit === "vh" || unit === "vmax" || unit === "vmin";
|
|
1602
|
+
};
|
|
1603
|
+
|
|
1599
1604
|
// src/utils/color.js
|
|
1600
1605
|
var import_globals = __toESM(require_cjs2(), 1);
|
|
1601
1606
|
var import_utils4 = __toESM(require_cjs(), 1);
|
|
@@ -1645,9 +1650,10 @@ var setSequenceValue = (props, sequenceProps) => {
|
|
|
1645
1650
|
sequenceProps.vars[variable] = scaling + sequenceProps.unit;
|
|
1646
1651
|
};
|
|
1647
1652
|
var setScalingVar = (key, sequenceProps) => {
|
|
1648
|
-
const { type } = sequenceProps;
|
|
1653
|
+
const { base, type, unit } = sequenceProps;
|
|
1654
|
+
const defaultVal = (isScalingUnit(unit) ? 1 : base) + unit;
|
|
1649
1655
|
if (key === 0)
|
|
1650
|
-
return
|
|
1656
|
+
return defaultVal;
|
|
1651
1657
|
const prefix = "--" + (type && type.replace(".", "-"));
|
|
1652
1658
|
const ratioVar = `${prefix}-ratio`;
|
|
1653
1659
|
if (key > 0) {
|
|
@@ -1811,9 +1817,9 @@ var applyGlobalVars = (vars, obj, options) => {
|
|
|
1811
1817
|
const ratioVar = `${prefix}-ratio`;
|
|
1812
1818
|
vars[ratioVar] = ratio;
|
|
1813
1819
|
const [first, middle, second] = getSubratio(base, ratio);
|
|
1814
|
-
vars[`${prefix}-sub-ratio-1`] = first
|
|
1815
|
-
vars[`${prefix}-sub-ratio-2`] = middle
|
|
1816
|
-
vars[`${prefix}-sub-ratio-3`] = second
|
|
1820
|
+
vars[`${prefix}-sub-ratio-1`] = `calc(var(${prefix}-ratio) * ${first / ratio})`;
|
|
1821
|
+
vars[`${prefix}-sub-ratio-2`] = `calc(var(${prefix}-ratio) * ${middle / ratio})`;
|
|
1822
|
+
vars[`${prefix}-sub-ratio-3`] = `calc(var(${prefix}-ratio) * ${second / ratio})`;
|
|
1817
1823
|
};
|
|
1818
1824
|
var applySequenceVars = (FACTORY2, options = {}) => {
|
|
1819
1825
|
const CONFIG2 = getActiveConfig();
|
|
@@ -30,9 +30,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
30
30
|
));
|
|
31
31
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
32
32
|
|
|
33
|
-
//
|
|
33
|
+
// ../../node_modules/@domql/utils/dist/cjs/key.js
|
|
34
34
|
var require_key = __commonJS({
|
|
35
|
-
"
|
|
35
|
+
"../../node_modules/@domql/utils/dist/cjs/key.js"(exports, module2) {
|
|
36
36
|
"use strict";
|
|
37
37
|
var __defProp2 = Object.defineProperty;
|
|
38
38
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -69,9 +69,9 @@ var require_key = __commonJS({
|
|
|
69
69
|
}
|
|
70
70
|
});
|
|
71
71
|
|
|
72
|
-
//
|
|
72
|
+
// ../../node_modules/@domql/utils/dist/cjs/env.js
|
|
73
73
|
var require_env = __commonJS({
|
|
74
|
-
"
|
|
74
|
+
"../../node_modules/@domql/utils/dist/cjs/env.js"(exports, module2) {
|
|
75
75
|
"use strict";
|
|
76
76
|
var __defProp2 = Object.defineProperty;
|
|
77
77
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -107,9 +107,9 @@ var require_env = __commonJS({
|
|
|
107
107
|
}
|
|
108
108
|
});
|
|
109
109
|
|
|
110
|
-
//
|
|
110
|
+
// ../../node_modules/@domql/utils/dist/cjs/globals.js
|
|
111
111
|
var require_globals = __commonJS({
|
|
112
|
-
"
|
|
112
|
+
"../../node_modules/@domql/utils/dist/cjs/globals.js"(exports, module2) {
|
|
113
113
|
"use strict";
|
|
114
114
|
var __defProp2 = Object.defineProperty;
|
|
115
115
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -143,9 +143,9 @@ var require_globals = __commonJS({
|
|
|
143
143
|
}
|
|
144
144
|
});
|
|
145
145
|
|
|
146
|
-
//
|
|
146
|
+
// ../../node_modules/@domql/utils/dist/cjs/node.js
|
|
147
147
|
var require_node = __commonJS({
|
|
148
|
-
"
|
|
148
|
+
"../../node_modules/@domql/utils/dist/cjs/node.js"(exports, module2) {
|
|
149
149
|
"use strict";
|
|
150
150
|
var __defProp2 = Object.defineProperty;
|
|
151
151
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -180,9 +180,9 @@ var require_node = __commonJS({
|
|
|
180
180
|
}
|
|
181
181
|
});
|
|
182
182
|
|
|
183
|
-
//
|
|
183
|
+
// ../../node_modules/@domql/utils/dist/cjs/types.js
|
|
184
184
|
var require_types = __commonJS({
|
|
185
|
-
"
|
|
185
|
+
"../../node_modules/@domql/utils/dist/cjs/types.js"(exports, module2) {
|
|
186
186
|
"use strict";
|
|
187
187
|
var __defProp2 = Object.defineProperty;
|
|
188
188
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -270,9 +270,9 @@ var require_types = __commonJS({
|
|
|
270
270
|
}
|
|
271
271
|
});
|
|
272
272
|
|
|
273
|
-
//
|
|
273
|
+
// ../../node_modules/@domql/utils/dist/cjs/array.js
|
|
274
274
|
var require_array = __commonJS({
|
|
275
|
-
"
|
|
275
|
+
"../../node_modules/@domql/utils/dist/cjs/array.js"(exports, module2) {
|
|
276
276
|
"use strict";
|
|
277
277
|
var __defProp2 = Object.defineProperty;
|
|
278
278
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -383,9 +383,9 @@ var require_array = __commonJS({
|
|
|
383
383
|
}
|
|
384
384
|
});
|
|
385
385
|
|
|
386
|
-
//
|
|
386
|
+
// ../../node_modules/@domql/utils/dist/cjs/string.js
|
|
387
387
|
var require_string = __commonJS({
|
|
388
|
-
"
|
|
388
|
+
"../../node_modules/@domql/utils/dist/cjs/string.js"(exports, module2) {
|
|
389
389
|
"use strict";
|
|
390
390
|
var __defProp2 = Object.defineProperty;
|
|
391
391
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -443,9 +443,9 @@ var require_string = __commonJS({
|
|
|
443
443
|
}
|
|
444
444
|
});
|
|
445
445
|
|
|
446
|
-
//
|
|
446
|
+
// ../../node_modules/@domql/utils/dist/cjs/object.js
|
|
447
447
|
var require_object = __commonJS({
|
|
448
|
-
"
|
|
448
|
+
"../../node_modules/@domql/utils/dist/cjs/object.js"(exports, module2) {
|
|
449
449
|
"use strict";
|
|
450
450
|
var __defProp2 = Object.defineProperty;
|
|
451
451
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -935,9 +935,9 @@ var require_object = __commonJS({
|
|
|
935
935
|
}
|
|
936
936
|
});
|
|
937
937
|
|
|
938
|
-
//
|
|
938
|
+
// ../../node_modules/@domql/utils/dist/cjs/function.js
|
|
939
939
|
var require_function = __commonJS({
|
|
940
|
-
"
|
|
940
|
+
"../../node_modules/@domql/utils/dist/cjs/function.js"(exports, module2) {
|
|
941
941
|
"use strict";
|
|
942
942
|
var __defProp2 = Object.defineProperty;
|
|
943
943
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -1010,9 +1010,9 @@ var require_function = __commonJS({
|
|
|
1010
1010
|
}
|
|
1011
1011
|
});
|
|
1012
1012
|
|
|
1013
|
-
//
|
|
1013
|
+
// ../../node_modules/@domql/utils/dist/cjs/log.js
|
|
1014
1014
|
var require_log = __commonJS({
|
|
1015
|
-
"
|
|
1015
|
+
"../../node_modules/@domql/utils/dist/cjs/log.js"(exports, module2) {
|
|
1016
1016
|
"use strict";
|
|
1017
1017
|
var __defProp2 = Object.defineProperty;
|
|
1018
1018
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -1051,9 +1051,9 @@ var require_log = __commonJS({
|
|
|
1051
1051
|
}
|
|
1052
1052
|
});
|
|
1053
1053
|
|
|
1054
|
-
//
|
|
1054
|
+
// ../../node_modules/@domql/utils/dist/cjs/cookie.js
|
|
1055
1055
|
var require_cookie = __commonJS({
|
|
1056
|
-
"
|
|
1056
|
+
"../../node_modules/@domql/utils/dist/cjs/cookie.js"(exports, module2) {
|
|
1057
1057
|
"use strict";
|
|
1058
1058
|
var __defProp2 = Object.defineProperty;
|
|
1059
1059
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -1107,9 +1107,9 @@ var require_cookie = __commonJS({
|
|
|
1107
1107
|
}
|
|
1108
1108
|
});
|
|
1109
1109
|
|
|
1110
|
-
//
|
|
1110
|
+
// ../../node_modules/@domql/utils/dist/cjs/tags.js
|
|
1111
1111
|
var require_tags = __commonJS({
|
|
1112
|
-
"
|
|
1112
|
+
"../../node_modules/@domql/utils/dist/cjs/tags.js"(exports, module2) {
|
|
1113
1113
|
"use strict";
|
|
1114
1114
|
var __defProp2 = Object.defineProperty;
|
|
1115
1115
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -1272,9 +1272,9 @@ var require_tags = __commonJS({
|
|
|
1272
1272
|
}
|
|
1273
1273
|
});
|
|
1274
1274
|
|
|
1275
|
-
//
|
|
1275
|
+
// ../../node_modules/@domql/utils/dist/cjs/index.js
|
|
1276
1276
|
var require_cjs = __commonJS({
|
|
1277
|
-
"
|
|
1277
|
+
"../../node_modules/@domql/utils/dist/cjs/index.js"(exports, module2) {
|
|
1278
1278
|
"use strict";
|
|
1279
1279
|
var __defProp2 = Object.defineProperty;
|
|
1280
1280
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -1584,6 +1584,11 @@ var getActiveConfig = (def) => {
|
|
|
1584
1584
|
return FACTORY[def || FACTORY.active];
|
|
1585
1585
|
};
|
|
1586
1586
|
|
|
1587
|
+
// src/utils/unit.js
|
|
1588
|
+
var isScalingUnit = (unit) => {
|
|
1589
|
+
return unit === "em" || unit === "rem" || unit === "vw" || unit === "vh" || unit === "vmax" || unit === "vmin";
|
|
1590
|
+
};
|
|
1591
|
+
|
|
1587
1592
|
// src/utils/color.js
|
|
1588
1593
|
var import_globals = __toESM(require_cjs2(), 1);
|
|
1589
1594
|
var import_utils2 = __toESM(require_cjs(), 1);
|
|
@@ -1644,9 +1649,10 @@ var setSequenceValue = (props, sequenceProps) => {
|
|
|
1644
1649
|
sequenceProps.vars[variable] = scaling + sequenceProps.unit;
|
|
1645
1650
|
};
|
|
1646
1651
|
var setScalingVar = (key, sequenceProps) => {
|
|
1647
|
-
const { type } = sequenceProps;
|
|
1652
|
+
const { base, type, unit } = sequenceProps;
|
|
1653
|
+
const defaultVal = (isScalingUnit(unit) ? 1 : base) + unit;
|
|
1648
1654
|
if (key === 0)
|
|
1649
|
-
return
|
|
1655
|
+
return defaultVal;
|
|
1650
1656
|
const prefix = "--" + (type && type.replace(".", "-"));
|
|
1651
1657
|
const ratioVar = `${prefix}-ratio`;
|
|
1652
1658
|
if (key > 0) {
|
|
@@ -1818,9 +1824,9 @@ var applyGlobalVars = (vars, obj, options) => {
|
|
|
1818
1824
|
const ratioVar = `${prefix}-ratio`;
|
|
1819
1825
|
vars[ratioVar] = ratio;
|
|
1820
1826
|
const [first, middle, second] = getSubratio(base, ratio);
|
|
1821
|
-
vars[`${prefix}-sub-ratio-1`] = first
|
|
1822
|
-
vars[`${prefix}-sub-ratio-2`] = middle
|
|
1823
|
-
vars[`${prefix}-sub-ratio-3`] = second
|
|
1827
|
+
vars[`${prefix}-sub-ratio-1`] = `calc(var(${prefix}-ratio) * ${first / ratio})`;
|
|
1828
|
+
vars[`${prefix}-sub-ratio-2`] = `calc(var(${prefix}-ratio) * ${middle / ratio})`;
|
|
1829
|
+
vars[`${prefix}-sub-ratio-3`] = `calc(var(${prefix}-ratio) * ${second / ratio})`;
|
|
1824
1830
|
};
|
|
1825
1831
|
var applySequenceVars = (FACTORY2, options = {}) => {
|
|
1826
1832
|
const CONFIG2 = getActiveConfig();
|
|
@@ -1848,7 +1854,7 @@ var applySequenceVars = (FACTORY2, options = {}) => {
|
|
|
1848
1854
|
};
|
|
1849
1855
|
var applyMediaSequenceVars = (FACTORY2, media, options = {}) => {
|
|
1850
1856
|
const CONFIG2 = getActiveConfig();
|
|
1851
|
-
const { UNIT: UNIT2, MEDIA: MEDIA2,
|
|
1857
|
+
const { UNIT: UNIT2, MEDIA: MEDIA2, CSS_VARS: CSS_VARS2 } = CONFIG2;
|
|
1852
1858
|
const mediaName = media.slice(1);
|
|
1853
1859
|
const unit = FACTORY2.unit || UNIT2.default;
|
|
1854
1860
|
const { mediaRegenerate } = FACTORY2;
|
|
@@ -1865,7 +1871,7 @@ var applyMediaSequenceVars = (FACTORY2, media, options = {}) => {
|
|
|
1865
1871
|
}
|
|
1866
1872
|
for (const key in sequence) {
|
|
1867
1873
|
const item = sequence[key];
|
|
1868
|
-
const value = (
|
|
1874
|
+
const value = (isScalingUnit(unit) ? scales[key] : sequence[key].val) + unit;
|
|
1869
1875
|
if (!query && CONFIG2.verbose)
|
|
1870
1876
|
console.warn("Can't find query ", query);
|
|
1871
1877
|
let underMediaQuery = CSS_VARS2[`@media ${query}`];
|
|
@@ -1874,7 +1880,6 @@ var applyMediaSequenceVars = (FACTORY2, media, options = {}) => {
|
|
|
1874
1880
|
underMediaQuery[item.variable] = `var(${item.variable + "_" + mediaName})`;
|
|
1875
1881
|
CSS_VARS2[item.variable + "_" + mediaName] = value;
|
|
1876
1882
|
}
|
|
1877
|
-
console.log(CSS_VARS2);
|
|
1878
1883
|
};
|
|
1879
1884
|
|
|
1880
1885
|
// src/utils/sprite.js
|
|
@@ -30,9 +30,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
30
30
|
));
|
|
31
31
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
32
32
|
|
|
33
|
-
//
|
|
33
|
+
// ../../node_modules/@domql/utils/dist/cjs/key.js
|
|
34
34
|
var require_key = __commonJS({
|
|
35
|
-
"
|
|
35
|
+
"../../node_modules/@domql/utils/dist/cjs/key.js"(exports, module2) {
|
|
36
36
|
"use strict";
|
|
37
37
|
var __defProp2 = Object.defineProperty;
|
|
38
38
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -69,9 +69,9 @@ var require_key = __commonJS({
|
|
|
69
69
|
}
|
|
70
70
|
});
|
|
71
71
|
|
|
72
|
-
//
|
|
72
|
+
// ../../node_modules/@domql/utils/dist/cjs/env.js
|
|
73
73
|
var require_env = __commonJS({
|
|
74
|
-
"
|
|
74
|
+
"../../node_modules/@domql/utils/dist/cjs/env.js"(exports, module2) {
|
|
75
75
|
"use strict";
|
|
76
76
|
var __defProp2 = Object.defineProperty;
|
|
77
77
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -107,9 +107,9 @@ var require_env = __commonJS({
|
|
|
107
107
|
}
|
|
108
108
|
});
|
|
109
109
|
|
|
110
|
-
//
|
|
110
|
+
// ../../node_modules/@domql/utils/dist/cjs/globals.js
|
|
111
111
|
var require_globals = __commonJS({
|
|
112
|
-
"
|
|
112
|
+
"../../node_modules/@domql/utils/dist/cjs/globals.js"(exports, module2) {
|
|
113
113
|
"use strict";
|
|
114
114
|
var __defProp2 = Object.defineProperty;
|
|
115
115
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -143,9 +143,9 @@ var require_globals = __commonJS({
|
|
|
143
143
|
}
|
|
144
144
|
});
|
|
145
145
|
|
|
146
|
-
//
|
|
146
|
+
// ../../node_modules/@domql/utils/dist/cjs/node.js
|
|
147
147
|
var require_node = __commonJS({
|
|
148
|
-
"
|
|
148
|
+
"../../node_modules/@domql/utils/dist/cjs/node.js"(exports, module2) {
|
|
149
149
|
"use strict";
|
|
150
150
|
var __defProp2 = Object.defineProperty;
|
|
151
151
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -180,9 +180,9 @@ var require_node = __commonJS({
|
|
|
180
180
|
}
|
|
181
181
|
});
|
|
182
182
|
|
|
183
|
-
//
|
|
183
|
+
// ../../node_modules/@domql/utils/dist/cjs/types.js
|
|
184
184
|
var require_types = __commonJS({
|
|
185
|
-
"
|
|
185
|
+
"../../node_modules/@domql/utils/dist/cjs/types.js"(exports, module2) {
|
|
186
186
|
"use strict";
|
|
187
187
|
var __defProp2 = Object.defineProperty;
|
|
188
188
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -270,9 +270,9 @@ var require_types = __commonJS({
|
|
|
270
270
|
}
|
|
271
271
|
});
|
|
272
272
|
|
|
273
|
-
//
|
|
273
|
+
// ../../node_modules/@domql/utils/dist/cjs/array.js
|
|
274
274
|
var require_array = __commonJS({
|
|
275
|
-
"
|
|
275
|
+
"../../node_modules/@domql/utils/dist/cjs/array.js"(exports, module2) {
|
|
276
276
|
"use strict";
|
|
277
277
|
var __defProp2 = Object.defineProperty;
|
|
278
278
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -383,9 +383,9 @@ var require_array = __commonJS({
|
|
|
383
383
|
}
|
|
384
384
|
});
|
|
385
385
|
|
|
386
|
-
//
|
|
386
|
+
// ../../node_modules/@domql/utils/dist/cjs/string.js
|
|
387
387
|
var require_string = __commonJS({
|
|
388
|
-
"
|
|
388
|
+
"../../node_modules/@domql/utils/dist/cjs/string.js"(exports, module2) {
|
|
389
389
|
"use strict";
|
|
390
390
|
var __defProp2 = Object.defineProperty;
|
|
391
391
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -443,9 +443,9 @@ var require_string = __commonJS({
|
|
|
443
443
|
}
|
|
444
444
|
});
|
|
445
445
|
|
|
446
|
-
//
|
|
446
|
+
// ../../node_modules/@domql/utils/dist/cjs/object.js
|
|
447
447
|
var require_object = __commonJS({
|
|
448
|
-
"
|
|
448
|
+
"../../node_modules/@domql/utils/dist/cjs/object.js"(exports, module2) {
|
|
449
449
|
"use strict";
|
|
450
450
|
var __defProp2 = Object.defineProperty;
|
|
451
451
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -935,9 +935,9 @@ var require_object = __commonJS({
|
|
|
935
935
|
}
|
|
936
936
|
});
|
|
937
937
|
|
|
938
|
-
//
|
|
938
|
+
// ../../node_modules/@domql/utils/dist/cjs/function.js
|
|
939
939
|
var require_function = __commonJS({
|
|
940
|
-
"
|
|
940
|
+
"../../node_modules/@domql/utils/dist/cjs/function.js"(exports, module2) {
|
|
941
941
|
"use strict";
|
|
942
942
|
var __defProp2 = Object.defineProperty;
|
|
943
943
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -1010,9 +1010,9 @@ var require_function = __commonJS({
|
|
|
1010
1010
|
}
|
|
1011
1011
|
});
|
|
1012
1012
|
|
|
1013
|
-
//
|
|
1013
|
+
// ../../node_modules/@domql/utils/dist/cjs/log.js
|
|
1014
1014
|
var require_log = __commonJS({
|
|
1015
|
-
"
|
|
1015
|
+
"../../node_modules/@domql/utils/dist/cjs/log.js"(exports, module2) {
|
|
1016
1016
|
"use strict";
|
|
1017
1017
|
var __defProp2 = Object.defineProperty;
|
|
1018
1018
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -1051,9 +1051,9 @@ var require_log = __commonJS({
|
|
|
1051
1051
|
}
|
|
1052
1052
|
});
|
|
1053
1053
|
|
|
1054
|
-
//
|
|
1054
|
+
// ../../node_modules/@domql/utils/dist/cjs/cookie.js
|
|
1055
1055
|
var require_cookie = __commonJS({
|
|
1056
|
-
"
|
|
1056
|
+
"../../node_modules/@domql/utils/dist/cjs/cookie.js"(exports, module2) {
|
|
1057
1057
|
"use strict";
|
|
1058
1058
|
var __defProp2 = Object.defineProperty;
|
|
1059
1059
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -1107,9 +1107,9 @@ var require_cookie = __commonJS({
|
|
|
1107
1107
|
}
|
|
1108
1108
|
});
|
|
1109
1109
|
|
|
1110
|
-
//
|
|
1110
|
+
// ../../node_modules/@domql/utils/dist/cjs/tags.js
|
|
1111
1111
|
var require_tags = __commonJS({
|
|
1112
|
-
"
|
|
1112
|
+
"../../node_modules/@domql/utils/dist/cjs/tags.js"(exports, module2) {
|
|
1113
1113
|
"use strict";
|
|
1114
1114
|
var __defProp2 = Object.defineProperty;
|
|
1115
1115
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -1272,9 +1272,9 @@ var require_tags = __commonJS({
|
|
|
1272
1272
|
}
|
|
1273
1273
|
});
|
|
1274
1274
|
|
|
1275
|
-
//
|
|
1275
|
+
// ../../node_modules/@domql/utils/dist/cjs/index.js
|
|
1276
1276
|
var require_cjs = __commonJS({
|
|
1277
|
-
"
|
|
1277
|
+
"../../node_modules/@domql/utils/dist/cjs/index.js"(exports, module2) {
|
|
1278
1278
|
"use strict";
|
|
1279
1279
|
var __defProp2 = Object.defineProperty;
|
|
1280
1280
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -1592,6 +1592,11 @@ var getActiveConfig = (def) => {
|
|
|
1592
1592
|
// src/system/color.js
|
|
1593
1593
|
var import_utils9 = __toESM(require_cjs(), 1);
|
|
1594
1594
|
|
|
1595
|
+
// src/utils/unit.js
|
|
1596
|
+
var isScalingUnit = (unit) => {
|
|
1597
|
+
return unit === "em" || unit === "rem" || unit === "vw" || unit === "vh" || unit === "vmax" || unit === "vmin";
|
|
1598
|
+
};
|
|
1599
|
+
|
|
1595
1600
|
// src/utils/color.js
|
|
1596
1601
|
var import_globals = __toESM(require_cjs2(), 1);
|
|
1597
1602
|
var import_utils2 = __toESM(require_cjs(), 1);
|
|
@@ -1759,9 +1764,10 @@ var setSequenceValue = (props, sequenceProps) => {
|
|
|
1759
1764
|
sequenceProps.vars[variable] = scaling + sequenceProps.unit;
|
|
1760
1765
|
};
|
|
1761
1766
|
var setScalingVar = (key, sequenceProps) => {
|
|
1762
|
-
const { type } = sequenceProps;
|
|
1767
|
+
const { base, type, unit } = sequenceProps;
|
|
1768
|
+
const defaultVal = (isScalingUnit(unit) ? 1 : base) + unit;
|
|
1763
1769
|
if (key === 0)
|
|
1764
|
-
return
|
|
1770
|
+
return defaultVal;
|
|
1765
1771
|
const prefix = "--" + (type && type.replace(".", "-"));
|
|
1766
1772
|
const ratioVar = `${prefix}-ratio`;
|
|
1767
1773
|
if (key > 0) {
|