UNPKG

@brizy/ui

Version:
30 lines (29 loc) 824 B
import { ifElse } from "ramda"; import { emptyStyles, getHexByColorType, isNumber, isString } from "../utils"; import { BRZ_PREFIX } from "../constants"; export const NOTHING_IN_QUILL = "<p><br></p>"; export const getBackground = (color) => { return { [`--${BRZ_PREFIX}-rich-text-background`]: getHexByColorType(color) }; }; export const getCustomSize = (size) => { return { [`--${BRZ_PREFIX}-rich-text-height`]: `${size}px` }; }; export const makeBackground = ifElse(isString, getBackground, emptyStyles); export const customSize = ifElse(isNumber, getCustomSize, emptyStyles); export const formats = [ "bold", "italic", "underline", "strike", "align", "list", "indent", "size", "header", "link", "video", "color", "background", "clean", "blockquote", ];