This function sets one or more style properties on the given element. It is the programmatic alternative to ElementCSSInlineStyle.style
. It also has special support for vendor-prefixed properties.
The suffix Async differentiates this method from its Sync counterpart - writeSync()
. Unlike the Sync counterpart, writeAsync()
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 writeAsync from '@web-native-js/play-ui/src/css/writeAsync.js';