MDC DOM provides commonly-used utilities for inspecting, traversing, and manipulating the DOM.
Most of the time, you shouldn’t need to depend on
mdc-dom directly. It is useful however if you’d like to write custom components that follow MDC Web’s pattern and elegantly integrate with the MDC Web ecosystem.
npm install @material/dom
import * as ponyfill from '@material/dom/ponyfill';
ponyfill module provides the following functions:
||Returns the ancestor of the given element matching the given selector (which may be the element itself if it matches), or
||Returns true if the given element matches the given CSS selector.|