zss-engine 0.2.52 → 0.2.53
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.
|
@@ -25,22 +25,22 @@ function splitAtomicAndNested(obj, flat, nonFlat) {
|
|
|
25
25
|
}
|
|
26
26
|
});
|
|
27
27
|
}
|
|
28
|
-
function processAtomicProps(flatProps,
|
|
28
|
+
function processAtomicProps(flatProps, atomicHashes, allStyleSheets, parentAtRule) {
|
|
29
29
|
Object.entries(flatProps).forEach(([property, value]) => {
|
|
30
30
|
if (property.startsWith('@media') || property.startsWith('@container')) {
|
|
31
|
-
processAtomicProps(value, property);
|
|
31
|
+
processAtomicProps(value, atomicHashes, allStyleSheets, property);
|
|
32
32
|
}
|
|
33
33
|
else {
|
|
34
34
|
const CSSProp = (0, index_js_1.camelToKebabCase)(property);
|
|
35
35
|
const normalizedValue = (0, index_js_1.applyCssValue)(value, CSSProp);
|
|
36
36
|
const singlePropObj = { [property]: normalizedValue };
|
|
37
37
|
const atomicHash = (0, index_js_1.genBase36Hash)(singlePropObj, 1, 7);
|
|
38
|
-
atomicHashes
|
|
38
|
+
atomicHashes.push(atomicHash);
|
|
39
39
|
let styleSheet = (0, index_js_1.transpileAtomic)(property, value, atomicHash);
|
|
40
40
|
if (parentAtRule) {
|
|
41
41
|
styleSheet = `${parentAtRule} { ${styleSheet} }`;
|
|
42
42
|
}
|
|
43
|
-
allStyleSheets
|
|
43
|
+
allStyleSheets.push(styleSheet);
|
|
44
44
|
}
|
|
45
45
|
});
|
|
46
46
|
}
|
|
@@ -21,22 +21,22 @@ function splitAtomicAndNested(obj, flat, nonFlat) {
|
|
|
21
21
|
}
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
|
-
function processAtomicProps(flatProps,
|
|
24
|
+
function processAtomicProps(flatProps, atomicHashes, allStyleSheets, parentAtRule) {
|
|
25
25
|
Object.entries(flatProps).forEach(([property, value]) => {
|
|
26
26
|
if (property.startsWith('@media') || property.startsWith('@container')) {
|
|
27
|
-
processAtomicProps(value, property);
|
|
27
|
+
processAtomicProps(value, atomicHashes, allStyleSheets, property);
|
|
28
28
|
}
|
|
29
29
|
else {
|
|
30
30
|
const CSSProp = camelToKebabCase(property);
|
|
31
31
|
const normalizedValue = applyCssValue(value, CSSProp);
|
|
32
32
|
const singlePropObj = { [property]: normalizedValue };
|
|
33
33
|
const atomicHash = genBase36Hash(singlePropObj, 1, 7);
|
|
34
|
-
atomicHashes
|
|
34
|
+
atomicHashes.push(atomicHash);
|
|
35
35
|
let styleSheet = transpileAtomic(property, value, atomicHash);
|
|
36
36
|
if (parentAtRule) {
|
|
37
37
|
styleSheet = `${parentAtRule} { ${styleSheet} }`;
|
|
38
38
|
}
|
|
39
|
-
allStyleSheets
|
|
39
|
+
allStyleSheets.push(styleSheet);
|
|
40
40
|
}
|
|
41
41
|
});
|
|
42
42
|
}
|
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { CSSProperties, CreateStyle } from '../index.js';
|
|
2
2
|
declare function splitAtomicAndNested(obj: CSSProperties, flat: CreateStyle, nonFlat: CreateStyle): void;
|
|
3
|
-
declare function processAtomicProps(flatProps: Record<string, unknown>,
|
|
3
|
+
declare function processAtomicProps(flatProps: Record<string, unknown>, atomicHashes: string[], allStyleSheets: string[], parentAtRule?: string): void;
|
|
4
4
|
export { splitAtomicAndNested, processAtomicProps };
|