easy-style-shadow

v1.2.3
Easy way to inject style to web components with attach shadow. note that it only work if the shadow mode set to "open". This helper keep track of changes in the dom for keep the dom upgrade with the needed styles. so if you want to cancel the detectio
easy style shadow easy-style easy-shadow style-easy style-shadow shadow-easy shadow-style and 7 more...

easyStyleShadow

Easy way to inject style to web components with attach shadow. note that it only work if the shadow mode set to "open".

This helper keep track of changes in the dom for keep the dom upgrade with the needed styles. so if you want to cancel the detection in any point, you can invoke the return function that returned from this helper when you initialize it.

The second argument is for setting the timeout for detection cycle.

Usage: easyStyleShadow(css: { [key: string]: string }, timeout?: number): Function

import { easyStyleShadow } from 'easy-style-shadow'

const stopDetection = easyStyleShadow({
 'ion-not-styleable-element': `
    :host{
       padding-bottom: 5px;
    }
    ion-child-element{
      display: none !important;
    }
 `,
 'another-cool-element-from-new-library': `
  .cool-sub-element{
    color: yellow;
  }
 `
})
// if you want to stop the detection of this helper just invoke the return value in any time, like so:
stopDetection()

This module exported from utilizes project.

npm i easy-style-shadow

Metadata

  • MIT
  • Whatever
  • Natan Farkash
  • released 5/31/2021

Downloads

Maintainers