Munter / subfont

Command line tool to optimize your webfont loading. Aggressive subsetting based on your font use, self-hosting of Google fonts and preloading
MIT License
1.56k stars 29 forks source link

Font family is undetected when applied via class selector which contains escaped colon #173

Closed joeldbirch closed 4 months ago

joeldbirch commented 4 months ago

Font family is undetected when applied via class selector which contains escaped colon.

For example, I am using a utility CSS library named Hucssley which generates classes containing colons to separate property names from values.

.font-family\:default {
    font-family: Some Custom Font, sans-serif;
}
    <h1 class="font-family:default">font-family is applied but subfont doesn't detect it</h1>

When this selector is used to apply the font-family to an element, subfont does not detect the font-family as being used. However, if I manually change the CSS so a colon is not used, and I use that altered class in the HTML, subfont works as expected.

.font-family-default {
    font-family: Some Custom Font, sans-serif;
}
    <h1 class="font-family-default">font-family is applied and subfont DOES detects it</h1>
papandreou commented 4 months ago

Thanks for reporting! Should be fixed in 7.2.1.