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

Function getCSSFiles

packages/core/src/css/planner.ts:76–96  ·  view source on GitHub ↗
(face: FontFace)

Source from the content-addressed store, hash-verified

74};
75
76const getCSSFiles = (face: FontFace): string[] => {
77 const style = formatStyle(face.style);
78
79 if (face.isVariable) {
80 const axisKey = face.axisKey ?? 'wght';
81 return [style === 'normal' ? `${axisKey}.css` : `${axisKey}-${style}.css`];
82 }
83
84 // Static packages publish both weight and subset entrypoints.
85 const assetFilenames = [
86 style === 'normal' ? `${face.weight}.css` : `${face.weight}-${style}.css`,
87 `${face.subset}.css`,
88 ];
89
90 // Keep the legacy subset italic entrypoint.
91 if (style !== 'normal') {
92 assetFilenames.push(`${face.subset}-italic.css`);
93 }
94
95 return assetFilenames;
96};
97
98export {
99 getCSSFiles,

Callers 2

groupFacesByCSSFileFunction · 0.85

Calls 1

formatStyleFunction · 0.90

Tested by

no test coverage detected