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

Function variableReadme

packages/cli/src/templates/readme.ts:58–114  ·  view source on GitHub ↗
({
	id,
	family,
	version,
	weights,
	styles,
	subsets,
	variable,
	license,
}: Metadata)

Source from the content-addressed store, hash-verified

56If you have any suggestions or ideas to improve the performance of font loading or expand the existing library, feel free to star and contribute to this repository. You can share your suggestions or ideas by creating an [issue](https://github.com/fontsource/fontsource/issues).`;
57
58const variableReadme = ({
59 id,
60 family,
61 version,
62 weights,
63 styles,
64 subsets,
65 variable,
66 license,
67}: Metadata) => `# Fontsource ${family}
68
69[![npm (scoped)](https://img.shields.io/npm/v/@fontsource-variable/${id}?color=brightgreen)](https://www.npmjs.com/package/@fontsource-variable/${id}) [![Generic badge](https://img.shields.io/badge/fontsource-passing-brightgreen)](https://github.com/fontsource/fontsource) [![Monthly downloads](https://badgen.net/npm/dm/@fontsource-variable/${id})](https://github.com/fontsource/fontsource) [![Total downloads](https://badgen.net/npm/dt/@fontsource-variable/${id})](https://github.com/fontsource/fontsource) [![GitHub stars](https://img.shields.io/github/stars/fontsource/fontsource.svg?style=social&label=Star)](https://github.com/fontsource/fontsource/stargazers)
70
71The CSS and web font files to easily self-host the “${family}” variable font. Please visit the main [Fontsource website](https://fontsource.org/fonts/${id}) to view more details on this package.
72
73## Quick Installation
74
75Fontsource offers multiple methods to import the CSS, including using a bundler like Vite or using SASS. You can find full documentation [here](https://fontsource.org/docs/getting-started/introduction).
76
77\`\`\`javascript
78npm install @fontsource-variable/${id}
79\`\`\`
80
81Within your app entry file or site component, import it in.
82
83\`\`\`javascript
84import "@fontsource-variable/${id}"; // Defaults to wght axis
85import "@fontsource-variable/${id}/wght.css"; // Specify axis
86import "@fontsource-variable/${id}/wght-italic.css"; // Specify axis and style
87\`\`\`
88
89Supported variables:
90- Weights: \`[${String(weights)}]\`
91- Styles: \`[${String(styles)}]\`
92- Subsets: \`[${String(subsets)}]\`
93- Axes: \`[${String(Object.keys(variable).filter((axis) => axis !== 'ital'))}]\`
94
95> Note: \`italic\` may not be supported by all fonts. To learn more about what axes and styles are supported, please visit the [Fontsource website](https://fontsource.org/fonts/${id}).
96
97Finally, you can reference the font name in a CSS stylesheet, CSS Module, or CSS-in-JS.
98
99\`\`\`css
100body {
101 font-family: "${family} Variable";
102}
103\`\`\`
104
105## Licensing
106Always make sure to read the license for each font you use. Most of the fonts in the collection use the SIL Open Font License, v1.1. Some fonts use the Apache 2 license. The Ubuntu fonts use the Ubuntu Font License v1.0.
107
108${license.attribution}
109[${license.type}](${license.url})
110
111## Other Notes
112Font version (provided by source): \`${version}\`.
113
114If you have any suggestions or ideas to improve the performance of font loading or expand the existing library, feel free to star and contribute to this repository. You can share your suggestions or ideas by creating an [issue](https://github.com/fontsource/fontsource/issues).`;
115

Callers 1

readmeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected