@webstudio-is/css-engine 0.267.0 → 0.268.0
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/lib/index.js +14 -0
- package/package.json +2 -2
package/lib/index.js
CHANGED
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
// src/core/prefixer.ts
|
|
2
|
+
var isKeyword = (value, keyword) => {
|
|
3
|
+
if (value.type === "keyword") {
|
|
4
|
+
return value.value === keyword;
|
|
5
|
+
}
|
|
6
|
+
if (value.type === "layers") {
|
|
7
|
+
return value.value.some((layer) => isKeyword(layer, keyword));
|
|
8
|
+
}
|
|
9
|
+
return false;
|
|
10
|
+
};
|
|
2
11
|
var prefixStyles = (styleMap) => {
|
|
3
12
|
const newStyleMap = /* @__PURE__ */ new Map();
|
|
13
|
+
const backgroundClip = styleMap.get("background-clip");
|
|
14
|
+
const hasTextBackgroundClip = backgroundClip !== void 0 && isKeyword(backgroundClip, "text");
|
|
4
15
|
for (const [property, value] of styleMap) {
|
|
5
16
|
if (property === "background-clip") {
|
|
6
17
|
newStyleMap.set("-webkit-background-clip", value);
|
|
@@ -14,6 +25,9 @@ var prefixStyles = (styleMap) => {
|
|
|
14
25
|
if (property === "backdrop-filter") {
|
|
15
26
|
newStyleMap.set("-webkit-backdrop-filter", value);
|
|
16
27
|
}
|
|
28
|
+
if (property === "color" && hasTextBackgroundClip && isKeyword(value, "transparent")) {
|
|
29
|
+
newStyleMap.set("-webkit-text-fill-color", value);
|
|
30
|
+
}
|
|
17
31
|
if (property === "view-timeline-name" || property === "scroll-timeline-name" || property === "view-timeline-inset") {
|
|
18
32
|
newStyleMap.set(`--${property}`, value);
|
|
19
33
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webstudio-is/css-engine",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.268.0",
|
|
4
4
|
"description": "CSS Renderer for Webstudio",
|
|
5
5
|
"author": "Webstudio <github@webstudio.is>",
|
|
6
6
|
"homepage": "https://webstudio.is",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"@emotion/hash": "^0.9.2",
|
|
10
10
|
"colorjs.io": "^0.6.1",
|
|
11
11
|
"zod": "^3.24.2",
|
|
12
|
-
"@webstudio-is/fonts": "0.
|
|
12
|
+
"@webstudio-is/fonts": "0.268.0"
|
|
13
13
|
},
|
|
14
14
|
"devDependencies": {
|
|
15
15
|
"@types/react": "^18.2.70",
|