packages/postcss-discard-unused/src/index.js
function filterFont({ atRules, values }) {
  values = uniqs(values);
  atRules.forEach((r) => {
    const families = r.nodes.filter(({ prop }) => prop === 'font-family');

    // Discard the @font-face if it has no font-family
    if (!families.length) {
      return r.remove();
    }

    families.forEach((family) => {
      if (!hasFont(family.value.toLowerCase(), values)) {
        r.remove();
      }
    });
  });
}
function filterFont({ atRules, values }) {
  values = uniqs(values);
  atRules.forEach((r) => {
    const families = r.nodes.filter(({ prop }) => prop === 'font-family');

    // Discard the @font-face if it has no font-family
    if (!families.length) {
      return r.remove();
    }

    families.forEach((family) => {
      if (!hasFont(family.value.toLowerCase(), values)) {
        r.remove();
      }
    });
  });
}
function filterFont ( { atRules , values } ) { values = uniqs ( values ) ; atRules . forEach ( ( r ) => { const families = r . nodes . filter ( ( { prop } ) => prop === 'font-family' ) ; // Discard the @font-face if it has no font-family if ( ! families . length ) { return r . remove ( ) ; } families . forEach ( ( family ) => { if ( ! hasFont ( family . value . toLowerCase ( ) , values ) ) { r . remove ( ) ; } } ) ; } ) ; }
fonts have slightly different logic
fonts have slightly different logic