npm

Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript.Learn more »

parasol

1.0.1 • Public • Published

parasol

Handy helpers for the Shadow DOM.

Codeship npm npm

Installation

npm install --save parasol

Usage

Given this DOM structure...

<my-parent> (Light DOM)
  (Shadow Root)
    ... (Shadow DOM)
      <my-child> (Shadow DOM)

closest(selectors)

Like Element.closest but breaks out of the Shadow root boundary.

import { closest } from 'parasol'
myChild::closest('my-parent') // <my-parent>

host()

Like ShadowRoot.host but works its way up the Shadow DOM until it finds the host.

import { host } from 'parasol'
myChild::host() // <my-parent>

Development

Run tests

npm test

See Also

install

npm i parasol

Downloadsweekly downloads

2

version

1.0.1

license

ISC

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
  • avatar
  • avatar
Report a vulnerability