Skip to content

Commit

Permalink
Handle inline SVGs correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
papandreou committed Sep 4, 2021
1 parent 7852e82 commit 7920755
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions lib/subsetFonts.js
Original file line number Diff line number Diff line change
Expand Up @@ -579,8 +579,15 @@ async function subsetFonts(

const memoizedGetCssRulesByProperty = memoizeSync(getCssRulesByProperty);
const htmlAssets = assetGraph.findAssets({
type: { $in: ['Html', 'Svg'] },
isInline: false,
$or: [
{
type: 'Html',
isInline: false,
},
{
type: 'Svg',
},
],
});
const traversalRelationQuery = {
$or: [
Expand Down Expand Up @@ -1071,7 +1078,7 @@ These glyphs are used on your site, but they don't exist in the font you applied
const cssRelation = htmlAsset.addRelation(
{
type: `${htmlAsset.type}Style`,
hrefType: inlineCss ? 'inline' : hrefType,
hrefType: inlineCss || htmlAsset.type === 'Svg' ? 'inline' : hrefType,
to: cssAsset,
},
'before',
Expand Down

0 comments on commit 7920755

Please sign in to comment.