I'm looking for a few sed expressions that I can use to produce some postcss artifacts. It's possible that I should break this up into 2 questions. Just let me know.
I'm creating this superfly-css-utility-fonts module. It's going to have font utilities like these:
.u-font-open-sans {
font-family: "Open Sans", var(--font-family-helvetica-neue) !important;
}
I plan on producing these using a PostCSS each loop like this:
@each $font in open-sans, lato, etc...
I have a list of all the google fonts that looks like this:
@import url('https://fonts.googleapis.com/css?family=Yeseva+One');
@import url('https://fonts.googleapis.com/css?family=Yesteryear');
@import url('https://fonts.googleapis.com/css?family=Yrsa');
@import url('https://fonts.googleapis.com/css?family=Zeyada');
With that input I need to output the comma separated values to be used in the loop. In other words:
yeseva-one, yesteryear, yrsa, zeyada, etc.
I also need to produce css variables like these:
--font-yeseva-one: "Yeseva One";
--font-yrsa: "Yrsa";
...
Ideally there would be 2 sed expressions to accomplish this goal, but other solutions would be great as well.