computeValue static method

CSSValue? computeValue(
  1. CSSValue cssValue, [
  2. DOMContext? domContext
])

Implementation

static CSSValue? computeValue(CSSValue cssValue, [DOMContext? domContext]) {
  if (cssValue is CSSFunction) {
    return cssValue.compute(domContext);
  } else if (cssValue.isFunction) {
    return CSSFunction.computeValue(cssValue._cssFunction!, domContext);
  } else if (cssValue is CSSNumber) {
    return cssValue;
  } else if (cssValue is CSSLength) {
    var resolved =
        CSSLength.resolveValue(domContext, cssValue.value, cssValue.unit);
    return resolved;
  }
  return null;
}