The rule is about requiring at least one generic font family in font declarations. But since there is not really a suitable generic fallback for icon fonts, the rule lets us specify the font families to ignore via the following property:
ignoreFontFamilies
Comma-separated list of font families exempt from this rule (regular expressions supported).
So according to the description, this should support regular expressions in some form. I have thus configured the following regex:
Material (Icons|Symbols)\s?(Outlined|Round|Sharp|Two Tone)?
The goal was to catch font families such as:
Material Icons
Material Icons Outlined
Material Symbols Outlined
Material Symbols Round
etc.
But this seems to have no effect. Am I using the regex incorrectly or is the description misleading and it does not actually support regexes?
Writing individual font names as comma-separated list works, but it can become quite a lot if you need to account for all the different permutations.
Thank you for your feedback. It appears that the rule property description lacks information on using regular expressions. The provided regular expression should adhere to JavaScript syntax for regular expression literals (/pattern/).
Please try adding the slash character (/) at the beginning and end of your regex as follows:
But yeah, some improvement to the description might help. I assume it’s also possible to configure multiple regexes by comma-separating them, or even mix regexes and literal strings.
In hindsight it’s plausible that CSS would be analyzed by a JavaScript engine, but it’s not obvious when you also have rules from other languages that use other regex engines.