classnameFilter = classname => {
        if (`.${classname}` in substClassnames) {
          classnames.add(classname);
        }
      }
Recursively replace ID and class references in CSS selectors

@param {string} str                  Original CSS text
@param {Array} rules                 CSS rules
@param {object} substIds             ID substitutions
@param {object} substClassnames      Class name substitutions
@returns {string}                    Substituted CSS text