closest = ( target, selector ) => {

	// Native Element.closest
	if( typeof target.closest === 'function' ) {
		return target.closest( selector );
	}

	// Polyfill
	while( target ) {
		if( matches( target, selector ) ) {
			return target;
		}

		// Keep searching
		target = target.parentNode;
	}

	return null;

}
Find the closest parent that matches the given
selector.

@param {HTMLElement} target The child element
@param {String} selector The CSS selector to match
the parents against

@return {HTMLElement} The matched parent or null
if no matching parent was found