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

Function camelCaseProperty

packages/css-data/src/parse-css.ts:65–86  ·  view source on GitHub ↗
(
  property: CssProperty | StyleProperty
)

Source from the content-addressed store, hash-verified

63 * @todo stop converting to camel case and use hyphenated format
64 */
65export const camelCaseProperty = (
66 property: CssProperty | StyleProperty
67): StyleProperty => {
68 property = normalizeProperty(property) as CssProperty | StyleProperty;
69 // these are manually added with pascal case
70 if (
71 property === "-webkit-font-smoothing" ||
72 property === "WebkitFontSmoothing"
73 ) {
74 return "WebkitFontSmoothing";
75 }
76 if (
77 property === "-moz-osx-font-smoothing" ||
78 property === "MozOsxFontSmoothing"
79 ) {
80 return "MozOsxFontSmoothing";
81 }
82 if (property.startsWith("-")) {
83 return property as StyleProperty;
84 }
85 return camelCase(property) as StyleProperty;
86};
87
88const parseCssValue = (property: CssProperty, value: string) => {
89 if (property.startsWith("--")) {

Callers 15

migrateStylesMutableFunction · 0.90
parse-css.test.tsFile · 0.90
css-to-ws.tsFile · 0.90
getTypesFunction · 0.90
renderTemplateFunction · 0.90
normalizeStylePropertyFunction · 0.90
createLocalStylesFunction · 0.90
generateFragmentFromHtmlFunction · 0.90
getCascadedValueFunction · 0.90
createModelFunction · 0.90
createOrMergeLocalStylesFunction · 0.90

Calls 1

normalizePropertyFunction · 0.85

Tested by 1

createModelFunction · 0.72