Get a style property value.
function getPropertyValue(
  cssRule: HTMLElementWithStyleMap | CSSStyleRule | CSSKeyframeRule,
  prop: string
): string {
  try {
    // Support CSSTOM.
    if (cssRule.attributeStyleMap) {
      return cssRule.attributeStyleMap.get(prop)
    }
    return cssRule.style.getPropertyValue(prop)
  } catch (err) {
    // IE may throw if property is unknown.
    return ''
  }
}