Provides resources for parsing style strings.

Constructors

Methods

Constructors

Methods

  • Parses a pixel string / computed styles. Ex. 100px returns 100.

    Parameters

    • value: string

      Value to parse.

    Returns number

    The integer component of a pixel string.

  • Returns the pixel value for 1rem based on the root document element. You may apply an optional multiplier.

    Parameters

    • Optionalmultiplier: number

      Optional multiplier to apply to rem pixel value; default: 1.

    • Optionaloptions: {
          targetDocument?: Document;
      }

      Optional parameters.

      • OptionaltargetDocument?: Document

        The target DOM Document if different from the main browser global document.

    Returns number

    The pixel value for 1rem with or without a multiplier based on the root document element.