processFont method

FontExpression processFont()

Implementation

FontExpression processFont() {
  // Process all parts of the font expression.
  FontExpression? fontSize;
  FontExpression? fontFamily;
  for (; _index < _exprs.expressions.length; _index++) {
    // Order is font-size font-family
    fontSize ??= processFontSize();
    fontFamily ??= processFontFamily();
    // TODO(terry): Handle font-weight, font-style, and font-variant. See
    //              https://github.com/dart-lang/csslib/issues/3
    //              https://github.com/dart-lang/csslib/issues/4
    //              https://github.com/dart-lang/csslib/issues/5
  }

  return FontExpression(_exprs.span,
      size: fontSize?.font.size,
      lineHeight: fontSize?.font.lineHeight,
      family: fontFamily?.font.family);
}