MCPcopy Index your code
hub / github.com/fontsource/fontsource / getFaceComment

Function getFaceComment

packages/core/src/css/face-rule.ts:38–49  ·  view source on GitHub ↗
(family: string, face: FontFace)

Source from the content-addressed store, hash-verified

36};
37
38const getFaceComment = (family: string, face: FontFace): string => {
39 const axisOrWeight =
40 typeof face.axisKey === 'string' ? face.axisKey.toLowerCase() : face.weight;
41
42 let comment = `${normalizeKebabCase(family)}-${face.subset}-${axisOrWeight}-${formatStyle(face.style)}`;
43
44 if (face.sliceIndex > 0) {
45 comment += `-${face.sliceIndex}`;
46 }
47
48 return comment;
49};
50
51// Variable fonts get a "Variable" suffix in their family name to avoid conflicts with static faces.
52// We need it when variable fonts are included and static files are present as a fallback.

Callers 1

renderFontFaceFunction · 0.85

Calls 2

normalizeKebabCaseFunction · 0.90
formatStyleFunction · 0.90

Tested by

no test coverage detected