camelCase to kebab-case
camelCase is common for JavaScript / TypeScript / Java variables and JSON keys in many web APIs; kebab-case is used for URLs, CSS classes and properties, HTML attributes and CLI flags. Moving data between languages, databases and APIs often means converting between the two.
Examples
| camelCase | kebab-case |
|---|---|
| backgroundColor | background-color |
| fontSize | font-size |
| userProfileCard | user-profile-card |
| maxWidth | max-width |
| onClick | on-click |