function getClosestMatch(elt, condition) {
    while (elt && !condition(elt)) {
      elt = parentElt(elt)
    }

    return elt || null
  }
@param {Node} elt
@param {(e:Node) => boolean} condition
@returns {Node | null}