@symbo.ls/scratch 2.11.255 → 2.11.261
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 +27 -27
- package/dist/cjs/index.js +71 -37
- package/dist/cjs/set.js +38 -37
- package/dist/cjs/system/color.js +27 -27
- package/dist/cjs/system/document.js +27 -27
- package/dist/cjs/system/font.js +29 -28
- package/dist/cjs/system/index.js +38 -37
- package/dist/cjs/system/reset.js +27 -27
- package/dist/cjs/system/shadow.js +38 -37
- package/dist/cjs/system/spacing.js +38 -37
- package/dist/cjs/system/svg.js +27 -27
- package/dist/cjs/system/theme.js +27 -27
- package/dist/cjs/system/timing.js +28 -28
- package/dist/cjs/system/typography.js +28 -28
- package/dist/cjs/transforms/index.js +143 -37
- package/dist/cjs/utils/color.js +27 -27
- package/dist/cjs/utils/index.js +28 -28
- package/dist/cjs/utils/sequence.js +28 -28
- package/dist/cjs/utils/sprite.js +27 -27
- package/dist/cjs/utils/var.js +27 -27
- package/package.json +2 -2
- package/src/system/spacing.js +5 -5
- package/src/transforms/index.js +37 -1
- package/src/utils/sequence.js +1 -0
package/dist/cjs/utils/var.js
CHANGED
|
@@ -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;
|
|
@@ -57,7 +57,7 @@ var require_key = __commonJS({
|
|
|
57
57
|
generateKey: () => generateKey
|
|
58
58
|
});
|
|
59
59
|
module2.exports = __toCommonJS2(key_exports);
|
|
60
|
-
var generateKey = function() {
|
|
60
|
+
var generateKey = /* @__PURE__ */ function() {
|
|
61
61
|
let index = 0;
|
|
62
62
|
function newId() {
|
|
63
63
|
index++;
|
|
@@ -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;
|
|
@@ -448,9 +448,9 @@ var require_string = __commonJS({
|
|
|
448
448
|
}
|
|
449
449
|
});
|
|
450
450
|
|
|
451
|
-
//
|
|
451
|
+
// ../../node_modules/@domql/utils/dist/cjs/object.js
|
|
452
452
|
var require_object = __commonJS({
|
|
453
|
-
"
|
|
453
|
+
"../../node_modules/@domql/utils/dist/cjs/object.js"(exports, module2) {
|
|
454
454
|
"use strict";
|
|
455
455
|
var __defProp2 = Object.defineProperty;
|
|
456
456
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -958,9 +958,9 @@ var require_object = __commonJS({
|
|
|
958
958
|
}
|
|
959
959
|
});
|
|
960
960
|
|
|
961
|
-
//
|
|
961
|
+
// ../../node_modules/@domql/utils/dist/cjs/function.js
|
|
962
962
|
var require_function = __commonJS({
|
|
963
|
-
"
|
|
963
|
+
"../../node_modules/@domql/utils/dist/cjs/function.js"(exports, module2) {
|
|
964
964
|
"use strict";
|
|
965
965
|
var __defProp2 = Object.defineProperty;
|
|
966
966
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -1033,9 +1033,9 @@ var require_function = __commonJS({
|
|
|
1033
1033
|
}
|
|
1034
1034
|
});
|
|
1035
1035
|
|
|
1036
|
-
//
|
|
1036
|
+
// ../../node_modules/@domql/utils/dist/cjs/log.js
|
|
1037
1037
|
var require_log = __commonJS({
|
|
1038
|
-
"
|
|
1038
|
+
"../../node_modules/@domql/utils/dist/cjs/log.js"(exports, module2) {
|
|
1039
1039
|
"use strict";
|
|
1040
1040
|
var __defProp2 = Object.defineProperty;
|
|
1041
1041
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -1074,9 +1074,9 @@ var require_log = __commonJS({
|
|
|
1074
1074
|
}
|
|
1075
1075
|
});
|
|
1076
1076
|
|
|
1077
|
-
//
|
|
1077
|
+
// ../../node_modules/@domql/utils/dist/cjs/cookie.js
|
|
1078
1078
|
var require_cookie = __commonJS({
|
|
1079
|
-
"
|
|
1079
|
+
"../../node_modules/@domql/utils/dist/cjs/cookie.js"(exports, module2) {
|
|
1080
1080
|
"use strict";
|
|
1081
1081
|
var __defProp2 = Object.defineProperty;
|
|
1082
1082
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -1130,9 +1130,9 @@ var require_cookie = __commonJS({
|
|
|
1130
1130
|
}
|
|
1131
1131
|
});
|
|
1132
1132
|
|
|
1133
|
-
//
|
|
1133
|
+
// ../../node_modules/@domql/utils/dist/cjs/tags.js
|
|
1134
1134
|
var require_tags = __commonJS({
|
|
1135
|
-
"
|
|
1135
|
+
"../../node_modules/@domql/utils/dist/cjs/tags.js"(exports, module2) {
|
|
1136
1136
|
"use strict";
|
|
1137
1137
|
var __defProp2 = Object.defineProperty;
|
|
1138
1138
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -1295,9 +1295,9 @@ var require_tags = __commonJS({
|
|
|
1295
1295
|
}
|
|
1296
1296
|
});
|
|
1297
1297
|
|
|
1298
|
-
//
|
|
1298
|
+
// ../../node_modules/@domql/utils/dist/cjs/index.js
|
|
1299
1299
|
var require_cjs = __commonJS({
|
|
1300
|
-
"
|
|
1300
|
+
"../../node_modules/@domql/utils/dist/cjs/index.js"(exports, module2) {
|
|
1301
1301
|
"use strict";
|
|
1302
1302
|
var __defProp2 = Object.defineProperty;
|
|
1303
1303
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@symbo.ls/scratch",
|
|
3
3
|
"description": "Φ / CSS framework and methodology.",
|
|
4
4
|
"author": "symbo.ls",
|
|
5
|
-
"version": "2.11.
|
|
5
|
+
"version": "2.11.261",
|
|
6
6
|
"files": [
|
|
7
7
|
"src",
|
|
8
8
|
"dist"
|
|
@@ -29,5 +29,5 @@
|
|
|
29
29
|
"@symbo.ls/utils": "latest",
|
|
30
30
|
"color-contrast-checker": "^1.5.0"
|
|
31
31
|
},
|
|
32
|
-
"gitHead": "
|
|
32
|
+
"gitHead": "53e63702105d8c7baf0f136c5756383533bf3b30"
|
|
33
33
|
}
|
package/src/system/spacing.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
3
|
import { arrayzeValue } from '@symbo.ls/utils'
|
|
4
|
-
import { isString, merge } from '@domql/utils'
|
|
4
|
+
import { isArray, isString, merge } from '@domql/utils'
|
|
5
5
|
|
|
6
6
|
import { getActiveConfig } from '../factory.js'
|
|
7
7
|
import {
|
|
@@ -70,13 +70,13 @@ export const getSpacingByKey = (
|
|
|
70
70
|
) => {
|
|
71
71
|
const sequence = getSequence(sequenceProps)
|
|
72
72
|
|
|
73
|
-
|
|
74
|
-
if (!stack) return
|
|
75
|
-
|
|
76
|
-
if (isString(value) && value.includes('calc')) {
|
|
73
|
+
if (isString(value) && (value.includes('calc') || value.includes('var'))) {
|
|
77
74
|
return { [propertyName]: value }
|
|
78
75
|
}
|
|
79
76
|
|
|
77
|
+
const stack = arrayzeValue(value)
|
|
78
|
+
if (!isArray(stack)) return
|
|
79
|
+
|
|
80
80
|
if (stack.length > 1) {
|
|
81
81
|
let suffix = ''
|
|
82
82
|
if (propertyName === 'borderWidth') {
|
package/src/transforms/index.js
CHANGED
|
@@ -8,7 +8,8 @@ import {
|
|
|
8
8
|
getShadow,
|
|
9
9
|
getMediaColor,
|
|
10
10
|
getTimingByKey,
|
|
11
|
-
getTimingFunction
|
|
11
|
+
getTimingFunction,
|
|
12
|
+
getSpacingBasedOnRatio
|
|
12
13
|
} from '../system'
|
|
13
14
|
|
|
14
15
|
const isBorderStyle = str => [
|
|
@@ -104,3 +105,38 @@ export const splitTransition = transition => {
|
|
|
104
105
|
if (!arr.length) return
|
|
105
106
|
return arr.map(transformTransition).join(',')
|
|
106
107
|
}
|
|
108
|
+
|
|
109
|
+
export const checkIfBoxSize = propertyName => {
|
|
110
|
+
const prop = propertyName.toLowerCase()
|
|
111
|
+
return (prop.includes('width') || prop.includes('height')) && !prop.includes('border')
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export const transformSize = (propertyName, val, props = {}, opts = {}) => {
|
|
115
|
+
let value = val !== undefined ? val : props[propertyName]
|
|
116
|
+
|
|
117
|
+
if (value === undefined) return
|
|
118
|
+
|
|
119
|
+
const shouldScaleBoxSize = props.scaleBoxSize
|
|
120
|
+
const isBoxSize = checkIfBoxSize(propertyName)
|
|
121
|
+
|
|
122
|
+
if (!shouldScaleBoxSize && isBoxSize && isString(value)) {
|
|
123
|
+
value = value.split(' ').map(v => {
|
|
124
|
+
const isSingleLetter = v.length < 3 && /[A-Z]/.test(v)
|
|
125
|
+
const hasUnits = ['%', 'vw', 'vh', 'ch'].some(unit => value.includes(unit))
|
|
126
|
+
if (isSingleLetter && !hasUnits) return v + '_default'
|
|
127
|
+
return v
|
|
128
|
+
}).join(' ')
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
if (opts.ratio) {
|
|
132
|
+
return getSpacingBasedOnRatio(props, propertyName, value)
|
|
133
|
+
} else {
|
|
134
|
+
return getSpacingByKey(value, propertyName)
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export const transformSizeRatio = (propertyName, props) => {
|
|
139
|
+
return transformSize(propertyName, null, props, {
|
|
140
|
+
ratio: true
|
|
141
|
+
})
|
|
142
|
+
}
|
package/src/utils/sequence.js
CHANGED