Verified Commit 6806ea67 authored by Dan Allen's avatar Dan Allen
Browse files

remove woff url in font face declarations

parent aa90900d
Pipeline #3489 failed with stage
in 36 seconds
......@@ -39,8 +39,12 @@ module.exports = function (eleventyConfig, rest) {
if (node.type === 'decl') {
if (node.prop === 'font-display') {
node.remove()
} else if (node.prop === 'src' && node.parent.name === 'font-face' && node.value.includes('.eot')) {
node.parent.remove()
} else if (node.prop === 'src' && node.parent.name === 'font-face') {
if (node.value.includes('.eot')) {
node.parent.remove()
} else {
node.value = node.value.replace(/^.*(url\('.+?\.woff2'\)).*$/, "$1 format('woff2')")
}
}
}
})
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment