since import * as A from 'fp-ts/lib/Array' ; import * as B from 'fp-ts/lib/boolean' ; import * as O from 'fp-ts/lib/Option' ; import * as RR from 'fp-ts/lib/ReadonlyRecord' ; import * as S from 'fp-ts/lib/Show' ; import { monoidString } from 'fp-ts/lib/Monoid' ; import { intercalate } from 'fp-ts/lib/Foldable' ; import { pipe } from 'fp-ts/lib/pipeable' ; category since export type FontFamily = string ; see https category since export interface FontOptions { /**
     * Represents the `font-style` CSS property.
     *
     * The `font-style` CSS property sets whether a font should be styled with a normal,
     * italic, or oblique face from its * font-family.
     */ readonly style : O . Option < string > ; /**
     * Represents the `font-variant` CSS property.
     *
     * The `font-variant` CSS property is a shorthand for the longhand properties `font-variant-caps`,
     * `font-variant-numeric`, `font-variant-alternates`, `font-variant-ligatures`, and `font-variant-east-asian`.
     */ readonly variant : O . Option < string > ; /**
     * Represnts the `font-weight` CSS property.
     *
     * The `font-weight` CSS property sets the weight (or boldness) of the font.
     */ readonly weight : O . Option < string > ; } see https category since export interface Font { /**
     * Represents the `font-family` CSS property.
     *
     * The `font-family` CSS property specifies a prioritized list of one or more
     * font family names and/or generic family names for the selected element.
     */ readonly fontFamily : FontFamily ; /**
     * Represents the `font-size` CSS property.
     *
     * The `font-size` CSS property sets the size of the font.
     */ readonly size : number ; /**
     * Represents optional values for modifying the style of a font.
     */ readonly fontOptions : FontOptions ; } category since export const fontOptions = ( { style , variant , weight } ) : FontOptions => ( { style : O . fromNullable ( style ) , variant : O . fromNullable ( variant ) , weight : O . fromNullable ( weight ) } ) ; category since export const font = ( fontFamily , size , options ? ) : Font => ( { fontFamily , size , fontOptions : typeof options === 'object' ? options : fontOptions ( { } ) } ) ; category since export const showFontOptions = { show : ( o ) => intercalate ( monoidString , RR . readonlyRecord ) ( ' ' , RR . compact ( RR . fromRecord ( o ) ) ) } ; category since export const showFont = { show : ( { fontFamily , size , fontOptions } ) => intercalate ( monoidString , A . array ) ( ' ' , A . compact ( [ pipe ( fontOptions , RR . fromRecord , RR . compact , RR . isEmpty , B . fold ( ( ) => O . some ( showFontOptions . show ( fontOptions ) ) , ( ) => O . none ) ) , O . some ( `${ size }px` ) , O . some ( fontFamily ) ] ) ) } ;