cssText method

String cssText()

Implementation

String cssText() {
  if (length != null) {
    // For computed style serialization of background-position axes, prefer
    // the authored absolute length for PX to avoid mixing in any cached
    // or layout-dependent adjustments. Other units (em/rem/%) still resolve
    // to absolute pixels via CSSLengthValue.cssText().
    if (length!.type == CSSLengthType.PX && length!.value != null) {
      return '${length!.value!.cssText()}px';
    }
    return length!.cssText();
  }
  if (percentage != null) {
    return '${((percentage! * 100 + 100) / 100 * 50).cssText()}%';
  }
  if (calcValue != null) {
    return '${(calcValue!.computedValue('') as double).cssText()}px';
  }
  return '';
}