UNPKG

@maggioli-design-system/design-tokens

Version:

This is the Design Token library of Maggioli Design System, here you'll find all the visual data used around the libraries.

44 lines (43 loc) 1.97 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.cssTailwindThemeTypography = exports.tailwindCss4Filter = void 0; const handlebars_1 = __importDefault(require("handlebars")); const fs_1 = __importDefault(require("fs")); const path_1 = __importDefault(require("path")); const package_json_1 = require("../../../package.json"); const helpers_1 = require("../helpers"); const templatePath = path_1.default.resolve(__dirname, './template.hbs'); const template = handlebars_1.default.compile(fs_1.default.readFileSync(templatePath).toString()); const ifTailwind4Border = (property, options) => { /* exclude number and default value keep prop as sm, md... */ return isNaN(Number(property)) ? options.fn(this) : options.inverse(this); }; handlebars_1.default.registerHelper('ifEquals', helpers_1.ifEquals); handlebars_1.default.registerHelper('leadZero', helpers_1.leadZero); handlebars_1.default.registerHelper('rgbChannel', helpers_1.rgbChannel); handlebars_1.default.registerHelper('kebabCase', helpers_1.kebabCase); handlebars_1.default.registerHelper('ifTailwindFontSizeProp', helpers_1.ifTailwindFontSizeProp); handlebars_1.default.registerHelper('tailwindFontSize', helpers_1.tailwindFontSize); handlebars_1.default.registerHelper('ifTailwind4Border', ifTailwind4Border); exports.tailwindCss4Filter = { name: 'tailwind/cssTailwind4Filter', matcher: function (token) { return !token.name.endsWith('default'); }, }; exports.cssTailwindThemeTypography = { name: 'css/tailwind-theme-typography', formatter: ({ dictionary, platform }) => { return template({ properties: dictionary.properties, date: new Date().toUTCString(), options: platform, version: package_json_1.version, }); }, };