UNPKG

@patreon/studio

Version:

Patreon Studio Design System

27 lines (26 loc) 997 B
import { css } from 'styled-components'; /** * Generates a css template which can be used to style a custom typography bundle. * * This function requires that you define all the propeties of your typographic style * completely. If you only need to change a few properties, use the `typeTokens` object * to fill in the original, default values. * * @warning this should be only used as an escape hatch for when Text components * and typography bundles are not capable of supporting the desired typography. */ export function cssForCustomText({ fontStack, fontSize, fontWeight, letterSpacing, lineHeight, fontWidth, }) { return css ` font-family: ${fontStack}; font-size: ${fontSize}; font-weight: ${fontWeight}; letter-spacing: ${letterSpacing}; line-height: ${lineHeight}; ${fontWidth && css ` font-variation-settings: ${fontWidth}; font-variant-numeric: lining-nums tabular-nums; `} `; } //# sourceMappingURL=cssForCustomText.js.map