MCPcopy Create free account
hub / github.com/fontsource/fontsource / renderDeclaration

Function renderDeclaration

packages/core/src/css/face-rule.ts:56–66  ·  view source on GitHub ↗
(property: string, value: CSSValue)

Source from the content-addressed store, hash-verified

54 isVariable && !family.endsWith(' Variable') ? `${family} Variable` : family;
55
56const renderDeclaration = (property: string, value: CSSValue): string => {
57 if (!Array.isArray(value)) {
58 return `${declarationIndent}${property}: ${value};`;
59 }
60
61 const continuationIndent = ' '.repeat(
62 `${declarationIndent + property}: `.length,
63 );
64
65 return `${declarationIndent}${property}: ${value.join(`,\n${continuationIndent}`)};`;
66};
67
68const renderFontFace = (
69 face: FontFace,

Callers 1

renderFontFaceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected