MCPcopy Create free account
hub / github.com/webstudio-is/webstudio / normalizeProperty

Function normalizeProperty

packages/css-data/src/parse-css.ts:45–58  ·  view source on GitHub ↗
(property: string)

Source from the content-addressed store, hash-verified

43const prefixRegex = new RegExp(`^-(${prefixes.join("|")})-`);
44
45const normalizeProperty = (property: string): CssProperty => {
46 // convert unprefixed used by webflow version into prefixed one
47 if (property === "tap-highlight-color") {
48 return "-webkit-tap-highlight-color";
49 }
50 if (property === "font-smoothing") {
51 return "-webkit-font-smoothing";
52 }
53 if (prefixedProperties.includes(property)) {
54 return property as CssProperty;
55 }
56 // remove old or unexpected prefixes
57 return property.replace(prefixRegex, "") as CssProperty;
58};
59
60/**
61 * Store prefixed properties without change

Callers 3

camelCasePropertyFunction · 0.85
enterFunction · 0.85
leaveFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected