/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
const require_entries = require("../packages/utils/dist/entries.cjs");
const require_index = require("../packages/css-tokens/dist/index.cjs");
const require_fromEntries = require("../packages/utils/dist/fromEntries.cjs");
const require_index$1 = require("../packages/fonts/dist/index.cjs");
//#region ../tailwind-internal/dist/utils/getFontStyles.js
/*! © 2026 Yahoo, Inc. UDS Tailwind Internal v0.0.0-development */
/**
* Tailwind does not automatically escape font names for you.
* If you’re using a font that contains an invalid identifier, wrap it in quotes or escape the invalid characters.
* @link https://tailwindcss.com/docs/font-family#customizing-your-theme:~:text=Tailwind%20does%20not%20automatically
*/
function escapeFontFamilyName(fontFamily) {
	return `"${fontFamily}"`;
}
/**
* Return CSS variables object based on font config.
* i.e. { --font-xyz: '"Font Family 1", "Font Family 2", sans-serif' }
*
* @example
* // 1. Use return value in style prop of an html element to assign font variables at runtime
*
* const fontVars = getFontStyles(fontConfig);
* <body style={fontVars}> {...} </body>
*
* // 2. Generate CSS at build time in tailwind plugin via addBase.
*
* const fontVars = getFontStyles(fontConfig);
* addBase(fontVars);
*
*/
function getFontStyles(fontConfig) {
	return require_fromEntries.fromEntries(require_entries.entries(fontConfig).map(([fontAlias, fontID]) => {
		const cssVar = `--${require_index.FONT_FAMILY_PREFIX}-${fontAlias}`;
		const font = require_index$1.FONT_DECLARATIONS_MAP[fontID];
		return [cssVar, [font.fontFamily, ...font.fallback].map(escapeFontFamilyName).join(", ")];
	}));
}
//#endregion
exports.getFontStyles = getFontStyles;
