Function parseMediaFeature

  • creates an AST from a media-feature string - including parentheses

    Parameters

    • str: string

    Returns FeatureNode | ParserError

    Example

    console.log(parseMediaFeature(`(min-width: 768px)`));
    // {
    // _t: "feature",
    // context: "value",
    // feature: "min-width",
    // value: { _t: "dimension", value: 768, unit: "px", start: 12, end: 16 },
    // start: 1,
    // end: 16,
    // }

Generated using TypeDoc