2
0
mirror of https://github.com/iconify/iconify.git synced 2025-01-07 07:34:22 +00:00

chore: publish update for tailwind plugin

This commit is contained in:
Vjacheslav Trushkin 2024-05-13 16:27:43 +03:00
parent a000307d6f
commit 21cf993858
2 changed files with 3 additions and 2 deletions

View File

@ -2,7 +2,7 @@
"name": "@iconify/tailwind", "name": "@iconify/tailwind",
"description": "Iconify plugin for Tailwind CSS", "description": "Iconify plugin for Tailwind CSS",
"author": "Vjacheslav Trushkin <cyberalien@gmail.com> (https://iconify.design)", "author": "Vjacheslav Trushkin <cyberalien@gmail.com> (https://iconify.design)",
"version": "1.0.1", "version": "1.1.0",
"license": "MIT", "license": "MIT",
"main": "./dist/plugin.js", "main": "./dist/plugin.js",
"types": "./dist/plugin.d.ts", "types": "./dist/plugin.d.ts",

View File

@ -8,7 +8,7 @@ import type { DynamicIconifyPluginOptions } from './helpers/options';
*/ */
export function getDynamicCSSRules( export function getDynamicCSSRules(
icon: string, icon: string,
{ scale = 1, ...options }: DynamicIconifyPluginOptions = {} options: DynamicIconifyPluginOptions = {}
): Record<string, string> { ): Record<string, string> {
const nameParts = icon.split(/--|\:/); const nameParts = icon.split(/--|\:/);
if (nameParts.length !== 2) { if (nameParts.length !== 2) {
@ -36,6 +36,7 @@ export function getDynamicCSSRules(
throw new Error(`Cannot find "${icon}". Bad icon name?`); throw new Error(`Cannot find "${icon}". Bad icon name?`);
} }
const scale = options.scale ?? 1;
if (scale) { if (scale) {
generated.common.rules.height = scale + 'em'; generated.common.rules.height = scale + 'em';
generated.common.rules.width = scale + 'em'; generated.common.rules.width = scale + 'em';