Skip to content

Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.

fix: preserve -webkit-text-stroke prefix in CSS parsing (#5584)

Oleg Isonenc5431eb96e5f
diff --git a/packages/css-data/src/parse-css.test.ts b/packages/css-data/src/parse-css.test.ts
index 6e83058bf8..b85074fdb1 100644
--- a/packages/css-data/src/parse-css.test.ts
+++ b/packages/css-data/src/parse-css.test.ts
@@ -539,6 +539,23 @@ describe("Parse CSS", () => {
]);
});
+ test("keep prefix for -webkit-text-stroke", () => {
+ // shorthand is kept as-is (not expanded) but prefix is preserved
+ expect(parseCss(`a { -webkit-text-stroke: 1px black; }`)).toEqual([
+ {
+ selector: "a",
+ property: "-webkit-text-stroke",
+ value: {
+ type: "tuple",
+ value: [
+ { type: "unit", unit: "px", value: 1 },
+ { type: "keyword", value: "black" },
+ ],
+ },
+ },
+ ]);
+ });
+
test("parse child combinator", () => {
expect(parseCss(`a > b { color: #ff0000 }`)).toEqual([
{
diff --git a/packages/css-data/src/parse-css.ts b/packages/css-data/src/parse-css.ts
index 5d519ed334..7fbbef961f 100644
--- a/packages/css-data/src/parse-css.ts
+++ b/packages/css-data/src/parse-css.ts
@@ -24,6 +24,9 @@ const prefixedProperties = [
"-moz-osx-font-smoothing",
"-webkit-tap-highlight-color",
"-webkit-overflow-scrolling",
+ "-webkit-text-stroke",
+ "-webkit-text-stroke-color",
+ "-webkit-text-stroke-width",
];
const prefixes = ["webkit", "moz", "ms", "o"];
const prefixRegex = new RegExp(`^-(${prefixes.join("|")})-`);