@brizy/ui
Version:
React elements in Brizy style
16 lines (15 loc) • 796 B
JavaScript
import { getHexByColorType } from "./colors";
import { BRZ_PREFIX } from "../constants";
export function getFieldsStyleTheme(theme) {
if (theme) {
const color = (theme === null || theme === void 0 ? void 0 : theme.color) ? { [`--${BRZ_PREFIX}-input-color`]: getHexByColorType(theme.color) } : {};
const background = (theme === null || theme === void 0 ? void 0 : theme.background)
? { [`--${BRZ_PREFIX}-input-background`]: getHexByColorType(theme.background) }
: {};
const borderColor = theme.borderColor
? { [`--${BRZ_PREFIX}-input-border-color`]: getHexByColorType(theme.borderColor) }
: {};
return Object.assign(Object.assign(Object.assign({}, color), background), borderColor);
}
return undefined;
}