Table of Contents

Class StyleFontClass

Namespace
Velvet
Assembly
Velvet.Docs.dll

Parses Velvet's font utility classes — font-<name> (family), font-thinfont-black (weight), italic / not-italic / bold-italic (style), plus the arbitrary font-[…] forms — into a single FontIntent. Mirrors Velvet.StyleGapClass's whole-array, last-wins extraction so it slots into the reconciler the same way. Resolution to actual assets/styles is done by StyleFontResolver.

public static class StyleFontClass
Inheritance
object
StyleFontClass

Methods

HasFontClass(string[])

Cheap early-out: true when ANY class is a font utility. Avoids the full TryExtract(string[], out FontIntent) scan on the elements (the vast majority) that carry no font class.

IsArbitraryFontClass(string)

True when cls is an arbitrary font class (font-[…]). These are owned by StyleFontResolver (resolved from the whole class array and applied as inline style), so the reconciler must keep them out of the USS class list — unlike the non-bracket font classes (font-bold, font-sans, …) which stay in the list as the USS fallback. Single source of truth for the AddClass / RemoveClass / ApplyClassNames exclusion checks.

TryExtract(string[], out FontIntent)

Scans classNames and folds every font utility into one FontIntent. Each facet (family / weight / italic) follows CSS cascade order: a later class of the same facet overrides an earlier one. Returns false when no font class is present.