Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
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
  • npm
  • Socket score

Version published
Weekly downloads
2
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

  1. Import polyfill:

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

    <link rel="import" href="bower_components/declarative-shadow-dom/declarative-shadow-dom.html">
    
  3. 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc