import { isDef } from './types' ; export function setAttr ( el , name , value ) { return el . setAttribute ( name , value ) ; } export function setStyle ( el , prop , value ) { return el . style . setProperty ( prop , value ) ; } export function addClass ( el , className ) { return el . classList . add ( className ) ; } export function removeClass ( el , className ) { return el . classList . remove ( className ) ; } export function toggleClass ( el , className ) { return el . classList . toggle ( className ) ; } export function existElement ( className , where ) { return isDef ( where ) ? where . querySelector ( `.${ className }` ) : document . querySelector ( `.${ className }` ) ; }