UNPKG

igniteui-theming

Version:

A set of Sass variables, mixins, and functions for generating palettes, typography, and elevations used by Ignite UI components.

35 lines (34 loc) 1.26 kB
import { PLATFORM_METADATA } from "../../knowledge/platforms/index.js"; import { SASS_USE_ASSEMBLY_NOTE } from "../../utils/sass.js"; import { generateTypography } from "../../generators/sass.js"; //#region src/tools/handlers/typography.ts /** * Handler for create_typography tool. */ function handleCreateTypography(params) { const result = generateTypography({ platform: params.platform, licensed: params.licensed, fontFamily: params.fontFamily, designSystem: params.designSystem, customScale: params.customScale, name: params.name }); const responseParts = [result.description]; const platformNote = params.platform ? `Platform: ${PLATFORM_METADATA[params.platform]?.name ?? params.platform}` : "Platform: Not specified (generic output). Specify `platform` for optimized code."; responseParts.push(""); responseParts.push(platformNote); responseParts.push(""); responseParts.push(`Variables used: ${result.variables.join(", ")}`); responseParts.push(""); responseParts.push("```scss"); responseParts.push(result.code.trimEnd()); responseParts.push("```"); responseParts.push(SASS_USE_ASSEMBLY_NOTE); return { content: [{ type: "text", text: responseParts.join("\n") }] }; } //#endregion export { handleCreateTypography };