aliascss
Version:
AliasCSS is a CSS post processor.
20 lines (19 loc) • 580 B
JavaScript
export default function font(font, custom) {
font = font.replace(/^[-_]/, '');
let holder = '';
font.split(/__/).forEach((e) => {
if (custom.hasOwnProperty('font') && typeof custom.font === 'object') {
if (custom.font.hasOwnProperty(e)) {
holder += custom.font[e] + ', ';
return;
}
}
if (e.search(/_/) !== -1) {
holder += '"' + e.replace(/_/g, ' ') + '", ';
}
else {
holder += e + ', ';
}
});
return holder.replace(/,[\s]$/, '');
}