zachleat / postcss-foft-classes

A postcss plugin to automatically add classes for various font loading strategies.
MIT License
90 stars 4 forks source link

Loading two fonts with one class gives an error #4

Open jonathanstegall opened 4 years ago

jonathanstegall commented 4 years ago

Using this code:

.pipe(
  postcss([
    foftLoadedClasses({
      groups: [
      {
        families: ["ff-meta-serif-web-pro", "ff-meta-web-pro"],
        classNames: ["fonts-loaded"]
      }
    ]
    }) // font loading
  ])
)

gives an error:

Message: Cannot read property 'split' of undefined Details: fileName: style.css domainEmitter: [object Object] domainThrown: false

But when I use only one font, it works fine:

.pipe(
  postcss([
    foftLoadedClasses({
      groups: [
      {
        families: ["ff-meta-serif-web-pro"],
        classNames: ["fonts-loaded"]
      }
    ]
    }) // font loading
  ])
)

Am I misunderstanding the syntax for multiple families?