arlyon / stailwc

Tailwind in SWC, Nextjs, and Vite, fast 🚀
https://npmjs.com/package/stailwc
Apache License 2.0
230 stars 3 forks source link

Multiple fonts in a fontFamily does not work #42

Open stouch opened 1 year ago

stouch commented 1 year ago

We cannot set multiple fonts for a fontFamily definition in our tailwind because on tw() render it concatenates with ` (space) instead of concatenating with,` (comma), so for :

// tailwind.config.js
{
    fontFamily: {
      body: ["Inter", "sans-serif"],
    }
}

we got :

/* once` transpiled on runtime : ... */
font-family: "Inter sans-serif"; 

and "Inter sans-serif" isnt an existing font.

halfbakedsneed commented 1 year ago

Yep, noticed the same thing.

Looks like it's joined incorrectly: https://github.com/arlyon/stailwc/blob/master/crates/tailwind-parse/src/eval/plugin.rs#L241

arlyon commented 1 year ago

Thanks for the report. Fixing now!