Created
March 22, 2018 17:00
-
-
Save sudarshang/b0ea5acf083dd9d194fe808a46b509b8 to your computer and use it in GitHub Desktop.
Convert css in js to styled component
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
video = { | |
width: '100%', | |
verticalAlign: 'bottom', | |
maxHeight: '508px', | |
objectFit: 'contain', | |
background: '#000000', | |
} | |
camelCaseToDash = (str) => str.replace(/([A-Z])/g, (g) => `-${g[0].toLowerCase()}`); | |
Object.entries(video).forEach(([key, value]) => { | |
console.log(`${camelCaseToDash(key)}: ${value};\n`) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment