DEV Community

convert JS Object to CSS in command

Kay Gosho on June 28, 2018

I found Styled Component is much convenient for me to write styles with React. However, I already wrote a lot of styles with JS object, using js...
Collapse
 
andy profile image
Andy Zhao (he/him)

Hey @maestromac right up your alley on this, especially with Preact.

Collapse
 
maestromac profile image
Mac Siri

Is there an advantage to write these kind of script in perl as supposed to vim-script?

Collapse
 
acro5piano profile image
Kay Gosho

Perl's Regular Expression is easy to write because it implements POSIX. In terms of performance vim-script may be better as calling external process is usually cost.

Collapse
 
vlasales profile image
Vlastimil Pospichal
:'<,'>s/\([A-Z]\)/-\l\1/g