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

Function getFaceStyle

packages/core/src/utils/variable.ts:76–89  ·  view source on GitHub ↗
(
	axisKey: VariableAxisKey,
	style: FontStyle,
	variableConfig: VariableAxisConfig,
)

Source from the content-addressed store, hash-verified

74
75/** Return the published CSS `font-style` for one axis key variant. */
76export const getFaceStyle = (
77 axisKey: VariableAxisKey,
78 style: FontStyle,
79 variableConfig: VariableAxisConfig,
80): FontStyle => {
81 const includesSlant =
82 axisKey === 'slnt' || axisKey === 'standard' || axisKey === 'full';
83
84 if (includesSlant && variableConfig.slnt) {
85 return `oblique ${formatSlantValue(variableConfig.slnt)}` as FontStyle;
86 }
87
88 return style;
89};
90
91/** Return the published CSS `font-stretch` for one axis key variant. */
92export const getFaceStretch = (

Callers 2

buildFontFunction · 0.90
resolveFontFacesFunction · 0.90

Calls 1

formatSlantValueFunction · 0.90

Tested by

no test coverage detected