You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

declarative-shadow-dom

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

declarative-shadow-dom

Custom Element to create Shadow DOM in a declarative manner

0.0.1
latest
Source
npmnpm
Version published
Weekly downloads
1
-50%
Maintainers
1
Weekly downloads
 
Created
Source

<declarative-shadow-dom>

Custom Element to create Shadow DOM in a declarative manner

Demo

Check it live!

Install

Install the component using Bower:

$ bower install declarative-shadow-dom --save

Or download as ZIP.

Usage

  • Import polyfill:

    <script src="bower_components/webcomponentsjs/webcomponents.min.js"></script>
    
  • Import custom element:

    <link rel="import" href="bower_components/declarative-shadow-dom/declarative-shadow-dom.html">
    
  • Start using it!

    <anyelement>
        <template is="declarative-shadow-dom">
            Shadow Content here
            <slot></slot>
        </template>
        Light DOM content here
    </anyelement>
    

Options

AttributeOptionsDefaultDescription
disabledBooleanfalseif set to true, the element will not stamp itself
stampedBooleanattribute that reflects whether the element is stamped or not, you can change it to stamp or clear the Shadow DOM

Methods

MethodParametersReturnsDescription
appendToParentsShadowRoot()None.Nothing.Appends content to parent element's shadow root, create one if needed.

Events

EventDescription
declarative-shadow-dom-stampedTriggers when Shadow DOM is stamped

Contributing and Development

History

For detailed changelog, check Releases.

License

MIT

FAQs

Package last updated on 12 Sep 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts