Standard escape codes are prefixed with Escape:
- Ctrl-Key:
^[ - Octal:
\033 - Unicode:
\u001b - Hexadecimal:
\x1B - Decimal:
27
| // Gist adapted from: https://gist.github.com/cms/369133 | |
| export getStyle(el: Element, styleProp: string): string { | |
| let value; | |
| const defaultView = el.ownerDocument.defaultView; | |
| // W3C standard way: | |
| if (defaultView && defaultView.getComputedStyle) { | |
| // sanitize property name to css notation (hypen separated words eg. font-Size) | |
| styleProp = styleProp.replace(/([A-Z])/g, '-$1').toLowerCase(); | |
| return defaultView.getComputedStyle(el, null).getPropertyValue(styleProp); | |
| } else if (el['currentStyle']) { // IE |