Converts hyphenated names to camelCase: font-size → fontSize, data-user-id → dataUserId. CSS properties, HTML attributes, CLI flags and many YAML keys are kebab-case, but the moment you touch them from JavaScript they become camelCase, as in element.style.fontSize, React's style prop or dataset.userId.
Paste a CSS rule, an attribute list or a set of flags to get the names you will use in script.
String box..toast {
font-size: 14px;
line-height: 1.4;
z-index: 50;
}.toast {
fontSize: 14px;
lineHeight: 1.4;
zIndex: 50;
}The three CSS property names are converted, ready for a React style object; the selector .toast and values like 14px stay. You still need to quote string values and replace ; with , for a JS object.
line-height → lineHeight.--main-color → --mainColor, which matters if you paste CSS custom properties.2024-01-01, are left unchanged.When a design hands over plain CSS for a single element, converting the declarations gives the camelCase keys React expects in style={{ ... }}.
data-order-id on an element is read as el.dataset.orderId. Converting gives dataOrderId; drop the data prefix and lowercase the next letter to get the dataset key.
Libraries such as yargs and commander expose --max-retries as maxRetries on the parsed options, so this shows the property name your code will read.
-- prefix, and the result is no longer a valid CSS variable reference. Do not convert those if you need them as CSS variables.total-discount, is indistinguishable from a kebab name and will be converted to totalDiscount. Paste names, not arithmetic.-webkit-transform become WebkitTransform?No. The leading hyphen stays and you get -webkitTransform. React expects WebkitTransform for vendor prefixes, so fix those few names by hand.
item-2?The digit segment is joined like any other word, so item-2 becomes item2 and col-12-md becomes col12Md. v2-api also works: v2Api.