@tokenami/css 0.0.30 → 0.0.31
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/index.cjs +4 -7
- package/dist/index.js +4 -7
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -48,10 +48,9 @@ var css = (baseStyles, ...overrides) => {
|
|
|
48
48
|
const cached = cache[cacheId];
|
|
49
49
|
if (cached)
|
|
50
50
|
return cached;
|
|
51
|
-
[baseStyles, ...overrides].forEach((
|
|
52
|
-
if (!
|
|
51
|
+
[baseStyles, ...overrides].forEach((overrideStyle) => {
|
|
52
|
+
if (!overrideStyle)
|
|
53
53
|
return;
|
|
54
|
-
let overrideStyle = Object.assign({}, originalOverrideStyle);
|
|
55
54
|
Object.entries(overrideStyle).forEach(([key, value]) => {
|
|
56
55
|
if (!Tokenami.TokenProperty.safeParse(key).success)
|
|
57
56
|
return;
|
|
@@ -60,17 +59,15 @@ var css = (baseStyles, ...overrides) => {
|
|
|
60
59
|
const cssProperties = Tokenami.getCSSPropertiesForAlias(parts.alias, css[_ALIASES]);
|
|
61
60
|
cssProperties.forEach((cssProperty) => {
|
|
62
61
|
const tokenPropertyLong = createTokenProperty(tokenProperty2, cssProperty);
|
|
63
|
-
delete overrideStyle[tokenProperty2];
|
|
64
62
|
overrideLonghands(overriddenStyles, tokenPropertyLong);
|
|
65
63
|
if (typeof value === "number" && value > 0) {
|
|
66
64
|
const gridVar = Tokenami.gridProperty();
|
|
67
|
-
|
|
65
|
+
overriddenStyles[tokenPropertyLong] = `calc(var(${gridVar}) * ${value})`;
|
|
68
66
|
} else {
|
|
69
|
-
|
|
67
|
+
overriddenStyles[tokenPropertyLong] = value;
|
|
70
68
|
}
|
|
71
69
|
});
|
|
72
70
|
});
|
|
73
|
-
Object.assign(overriddenStyles, overrideStyle);
|
|
74
71
|
});
|
|
75
72
|
cache[cacheId] = overriddenStyles;
|
|
76
73
|
return overriddenStyles;
|
package/dist/index.js
CHANGED
|
@@ -11,10 +11,9 @@ var css = (baseStyles, ...overrides) => {
|
|
|
11
11
|
const cached = cache[cacheId];
|
|
12
12
|
if (cached)
|
|
13
13
|
return cached;
|
|
14
|
-
[baseStyles, ...overrides].forEach((
|
|
15
|
-
if (!
|
|
14
|
+
[baseStyles, ...overrides].forEach((overrideStyle) => {
|
|
15
|
+
if (!overrideStyle)
|
|
16
16
|
return;
|
|
17
|
-
let overrideStyle = Object.assign({}, originalOverrideStyle);
|
|
18
17
|
Object.entries(overrideStyle).forEach(([key, value]) => {
|
|
19
18
|
if (!Tokenami.TokenProperty.safeParse(key).success)
|
|
20
19
|
return;
|
|
@@ -23,17 +22,15 @@ var css = (baseStyles, ...overrides) => {
|
|
|
23
22
|
const cssProperties = Tokenami.getCSSPropertiesForAlias(parts.alias, css[_ALIASES]);
|
|
24
23
|
cssProperties.forEach((cssProperty) => {
|
|
25
24
|
const tokenPropertyLong = createTokenProperty(tokenProperty2, cssProperty);
|
|
26
|
-
delete overrideStyle[tokenProperty2];
|
|
27
25
|
overrideLonghands(overriddenStyles, tokenPropertyLong);
|
|
28
26
|
if (typeof value === "number" && value > 0) {
|
|
29
27
|
const gridVar = Tokenami.gridProperty();
|
|
30
|
-
|
|
28
|
+
overriddenStyles[tokenPropertyLong] = `calc(var(${gridVar}) * ${value})`;
|
|
31
29
|
} else {
|
|
32
|
-
|
|
30
|
+
overriddenStyles[tokenPropertyLong] = value;
|
|
33
31
|
}
|
|
34
32
|
});
|
|
35
33
|
});
|
|
36
|
-
Object.assign(overriddenStyles, overrideStyle);
|
|
37
34
|
});
|
|
38
35
|
cache[cacheId] = overriddenStyles;
|
|
39
36
|
return overriddenStyles;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tokenami/css",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.31",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -12,17 +12,17 @@
|
|
|
12
12
|
"dist"
|
|
13
13
|
],
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@tokenami/config": "0.0.
|
|
15
|
+
"@tokenami/config": "0.0.31"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
18
|
"tsup": "^7.0.0",
|
|
19
19
|
"typescript": "^5.1.3",
|
|
20
20
|
"vitest": "^0.34.6",
|
|
21
|
-
"@tokenami/dev": "0.0.
|
|
21
|
+
"@tokenami/dev": "0.0.31"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
24
|
"typescript": ">= 5",
|
|
25
|
-
"@tokenami/dev": "0.0.
|
|
25
|
+
"@tokenami/dev": "0.0.31"
|
|
26
26
|
},
|
|
27
27
|
"scripts": {
|
|
28
28
|
"build": "tsup",
|