This function returns one or more style properties for the given element. It is a convenient alternative to window.getComputedStyle
. It also has special support for vendor-prefixed properties.
The suffix Async differentiates this method from its Sync counterpart - readSync()
. Unlike the Sync counterpart, readAsync()
is a promised-based function that runs in a different flow from that of the calling code. It follows a performance strategy that lets the browser engine decide the most convenient time to honour its call.
import readAsync from '@web-native-js/play-ui/src/css/readAsync.js';