UNPKG

@brizy/ui

Version:
20 lines (19 loc) 993 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getIconSize = exports.getIconSource = exports.getIconColor = void 0; const utils_1 = require("../utils"); const constants_1 = require("../constants"); const getIconColor = (color, hoverColor) => { if (color || hoverColor) { const iconColor = color ? { [`--${constants_1.BRZ_PREFIX}-icon-color`]: (0, utils_1.getHexByColorType)(color) } : {}; const iconHoverColor = hoverColor ? { [`--${constants_1.BRZ_PREFIX}-icon-hover-color`]: (0, utils_1.getHexByColorType)(hoverColor) } : {}; return Object.assign(Object.assign({}, iconColor), iconHoverColor); } }; exports.getIconColor = getIconColor; const getIconSource = (source) => ({ [`--${constants_1.BRZ_PREFIX}-icon-image-source`]: `url("${source}")`, }); exports.getIconSource = getIconSource; const getIconSize = (size) => size ? { [`--${constants_1.BRZ_PREFIX}-icon-size`]: size } : {}; exports.getIconSize = getIconSize;