@tokenami/css 0.0.31 → 0.0.33
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 +6 -7
- package/dist/index.js +6 -7
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -48,10 +48,10 @@ 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((originalStyles) => {
|
|
52
|
+
if (!originalStyles)
|
|
53
53
|
return;
|
|
54
|
-
Object.entries(
|
|
54
|
+
Object.entries(originalStyles).forEach(([key, value]) => {
|
|
55
55
|
if (!Tokenami.TokenProperty.safeParse(key).success)
|
|
56
56
|
return;
|
|
57
57
|
const tokenProperty2 = key;
|
|
@@ -59,13 +59,12 @@ var css = (baseStyles, ...overrides) => {
|
|
|
59
59
|
const cssProperties = Tokenami.getCSSPropertiesForAlias(parts.alias, css[_ALIASES]);
|
|
60
60
|
cssProperties.forEach((cssProperty) => {
|
|
61
61
|
const tokenPropertyLong = createTokenProperty(tokenProperty2, cssProperty);
|
|
62
|
-
overrideLonghands(overriddenStyles, tokenPropertyLong);
|
|
63
62
|
if (typeof value === "number" && value > 0) {
|
|
64
63
|
const gridVar = Tokenami.gridProperty();
|
|
65
|
-
|
|
66
|
-
} else {
|
|
67
|
-
overriddenStyles[tokenPropertyLong] = value;
|
|
64
|
+
value = `calc(var(${gridVar}) * ${value})`;
|
|
68
65
|
}
|
|
66
|
+
overrideLonghands(overriddenStyles, tokenPropertyLong);
|
|
67
|
+
Object.assign(overriddenStyles, { [tokenPropertyLong]: value });
|
|
69
68
|
});
|
|
70
69
|
});
|
|
71
70
|
});
|
package/dist/index.js
CHANGED
|
@@ -11,10 +11,10 @@ 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((originalStyles) => {
|
|
15
|
+
if (!originalStyles)
|
|
16
16
|
return;
|
|
17
|
-
Object.entries(
|
|
17
|
+
Object.entries(originalStyles).forEach(([key, value]) => {
|
|
18
18
|
if (!Tokenami.TokenProperty.safeParse(key).success)
|
|
19
19
|
return;
|
|
20
20
|
const tokenProperty2 = key;
|
|
@@ -22,13 +22,12 @@ var css = (baseStyles, ...overrides) => {
|
|
|
22
22
|
const cssProperties = Tokenami.getCSSPropertiesForAlias(parts.alias, css[_ALIASES]);
|
|
23
23
|
cssProperties.forEach((cssProperty) => {
|
|
24
24
|
const tokenPropertyLong = createTokenProperty(tokenProperty2, cssProperty);
|
|
25
|
-
overrideLonghands(overriddenStyles, tokenPropertyLong);
|
|
26
25
|
if (typeof value === "number" && value > 0) {
|
|
27
26
|
const gridVar = Tokenami.gridProperty();
|
|
28
|
-
|
|
29
|
-
} else {
|
|
30
|
-
overriddenStyles[tokenPropertyLong] = value;
|
|
27
|
+
value = `calc(var(${gridVar}) * ${value})`;
|
|
31
28
|
}
|
|
29
|
+
overrideLonghands(overriddenStyles, tokenPropertyLong);
|
|
30
|
+
Object.assign(overriddenStyles, { [tokenPropertyLong]: value });
|
|
32
31
|
});
|
|
33
32
|
});
|
|
34
33
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tokenami/css",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.33",
|
|
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.33"
|
|
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.33"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
24
|
"typescript": ">= 5",
|
|
25
|
-
"@tokenami/dev": "0.0.
|
|
25
|
+
"@tokenami/dev": "0.0.33"
|
|
26
26
|
},
|
|
27
27
|
"scripts": {
|
|
28
28
|
"build": "tsup",
|