nobadfonts-cli 1.1.7 → 1.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +8 -3
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -217,13 +217,18 @@ async function addFont(fontName) {
|
|
|
217
217
|
const newCssBlock = `
|
|
218
218
|
/* Font: ${font.name} (Added via NoBadFonts CLI) */
|
|
219
219
|
${cssContent.join('\n')}
|
|
220
|
+
|
|
221
|
+
@theme {
|
|
222
|
+
--font-${font.slug}: "${font.name}", sans-serif;
|
|
223
|
+
}
|
|
220
224
|
`;
|
|
221
225
|
|
|
222
226
|
if (!existingCss.includes(`Font: ${font.name}`)) {
|
|
223
227
|
await fs.outputFile(outputCssPath, existingCss + newCssBlock);
|
|
224
|
-
spinner.succeed(chalk.green(`Updated src/fonts.css with @font-face definitions.`));
|
|
225
|
-
console.log(chalk.blue(`\nSuccess! To use the font
|
|
226
|
-
console.log(chalk.cyan(`font-family:
|
|
228
|
+
spinner.succeed(chalk.green(`Updated src/fonts.css with @font-face definitions and @theme variable.`));
|
|
229
|
+
console.log(chalk.blue(`\nSuccess! To use the font:`));
|
|
230
|
+
console.log(chalk.cyan(`1. In CSS: font-family: var(--font-${font.slug});`));
|
|
231
|
+
console.log(chalk.cyan(`2. In Tailwind: class="font-${font.slug}"`));
|
|
227
232
|
console.log(chalk.gray(`(Make sure to import './fonts.css' in your main execution file)`));
|
|
228
233
|
} else {
|
|
229
234
|
spinner.info(chalk.yellow(`Font ${font.name} definitions already exist in src/fonts.css`));
|