Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

camelcase to css variable javascript

 const formatCamelCaseIntoCssVariables = (camelCase) => {
  const str = camelCase.replace(/B([A-Z])B/g, '-$1').toLowerCase();
  return str.padStart(str.length + 2, '-');
};
 
PREVIOUS NEXT
Tagged: #camelcase #css #variable #javascript
ADD COMMENT
Topic
Name
7+5 =