Link Search Menu Expand Document

Font overview

Added in v1.0.0


Table of contents


constructors

font

Constructs a new Font.

Signature

export declare const font: (fontFamily: string, size: number, options?: FontOptions) => Font

Added in v1.0.0

fontOptions

Constructs a new FontOptions object.

Signature

export declare const fontOptions: ({
  style,
  variant,
  weight,
}: {
  readonly style?: string
  readonly variant?: string
  readonly weight?: string
}) => FontOptions

Added in v1.0.0

instances

showFont

The Show instance for Font.

Signature

export declare const showFont: S.Show<Font>

Added in v1.0.0

showFontOptions

The Show instance for FontOptions.

Signature

export declare const showFontOptions: S.Show<FontOptions>

Added in v1.0.0

model

Font (interface)

Represents the font CSS property.

Signature

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
}

Added in v1.0.0

FontFamily (type alias)

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.

Signature

export type FontFamily = string

Added in v1.0.0

FontOptions (interface)

Represents optional values for modifying the style of a font.

Signature

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>
}

Added in v1.0.0