From f95de9fece38a7d7ce9eddb78644e754351c80c1 Mon Sep 17 00:00:00 2001 From: Jonas Ohlsson Aden Date: Thu, 1 Oct 2020 14:44:32 +0200 Subject: [PATCH] fix: make font-name filter checks case-insensitive --- src/postformatting/unused-fontface-remover.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/postformatting/unused-fontface-remover.js b/src/postformatting/unused-fontface-remover.js index 1ed08a8f..cfb2969f 100644 --- a/src/postformatting/unused-fontface-remover.js +++ b/src/postformatting/unused-fontface-remover.js @@ -28,7 +28,7 @@ function getAllFontNameValues (ast) { const familyName = decodeFontName({ type: 'Value', children: entry.nodes - }) + }).toLowerCase() if (!fontNameValues.has(familyName)) { debuglog('found used font-family: ' + familyName) fontNameValues.add(familyName) @@ -64,7 +64,7 @@ export default function unusedFontfaceRemover (ast) { const name = csstree.property(declaration.property).name if (name === 'font-family') { - const familyName = decodeFontName(declaration.value) + const familyName = decodeFontName(declaration.value).toLowerCase() // was this @font-face used? if (!fontNameValues.has(familyName)) {