UNPKG

@ryusei/light

Version:

<div align="center"> <a href="https://light.ryuseijs.com"> <img alt="RyuseiLight" src="https://light.ryuseijs.com/images/svg/logo.svg" width="70"> </a>

15 lines (12 loc) 402 B
import { forOwn } from '../../object'; /** * Applies inline styles to the provided element by an object literal. * * @param elm - An element to apply styles to. * @param styles - An object literal with styles. */ export function styles( elm: HTMLElement, styles: Record<string, string | number> ): void { forOwn( styles, ( value, key ) => { elm.style[ key ] = String( value ); } ); }