Directory

css-observe - Vaadin Add-on Directory

Fire a custom event whenever an element matching a specified selector is added. css-observe - Vaadin Add-on Directory
[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://www.webcomponents.org/element/css-observe) # css-observe Fire a custom event whenever an element matching a specified selector is added. ## Syntax ## Example ```html
I am here
``` css-observe will fire event: latest-match-changed, and the newly added element can be obtained from event.detail.value. It will only observe the selector within the same Shadow DOM realm where the element is placed. If the element is placed outside any ShadowDOM, it will observe the selector only outside any ShadowDOM. How cool is that? ## Implementation Based off of an idea found [here](https://davidwalsh.name/detect-node-insertion) ## Viewing Your Element ``` $ polymer serve ``` ## Running Tests ``` $ npm tests ```