resolveCSSViewportUnitValue method

String resolveCSSViewportUnitValue(
  1. num value,
  2. CSSUnit unit, {
  3. bool originalValueAsComment = true,
})

Resolves a Viewport CSSUnit (vw, vh, vmin, vmax) value to a px value as String.

Implementation

String resolveCSSViewportUnitValue(num value, CSSUnit unit,
    {bool originalValueAsComment = true}) {
  var resolved = resolveViewportCSSLength(value, unit);
  var resolvedStr = resolved.toString(this);

  if (originalValueAsComment) {
    var originalValue = resolveCSSUnitValue(value, unit);
    resolvedStr += ' /* DOMContext-original-value: $originalValue */';
  }

  return resolvedStr;
}