Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
depay-react-shadow-dom
Advanced tools
A library to easily render react compatible shadow DOMs for web components with individual styling for inside and outside.
yarn add depay-react-shadow-dom
import { ReactShadowDOM } from 'depay-react-shadow-dom';
ReactShadowDOM({
document,
element,
content,
outsideStyle: outsideStyle,
insideStyle: insideStyle
})
The function ReactShadowDOM
renders a react compontent (content
) into an insideContainer
that lives inside a shadowRoot of the outsideContainer
target element (element
) within a given document (document
) while also applying insideStyle
to the insideContainer
and outsideStyle
to the outsideContainer
.
You can either pas a ReactElement to content
or a function. In case of a function
that function will be call with the insideContainer
as an argument and it's expected to return a ReactElement.
While outsideStyle
is applied to the outside container directly:
outsideStyle: `
border: 1px solid red;
color: black;
`
<div class="ReactShadowDOMOutsideContainer" style="border: 1px solid red;color: black;"></div>
insideStyle
is wrapped in a style tag and prepend to the shadowRoot:
insideStyle: `
.ReactShadowDOMInsideContainer {
background: blue;
color: white;
}
`
#shadow-root
<style type="text/css">.ReactShadowDOMInsideContainer {background: blue;color: white;}</style>
<div class="ReactShadowDOMInsideContainer"><h1>I'm in a ShadowDOM</h1></div>
wich allows you to style all elements and classes within the shadowRoot.
In order to completly unmount everything (removing containers and unmounting React components),
the ReactShadowDOM
function returns an object containing an unmount
function:
let { unmount } = ReactShadowDOM(...)
unmount()
yarn install
yarn demo
yarn test:integration
npm publish
FAQs
A library to easily render react compatible shadow DOMs for web components with individual styling for inside and outside.
The npm package depay-react-shadow-dom receives a total of 0 weekly downloads. As such, depay-react-shadow-dom popularity was classified as not popular.
We found that depay-react-shadow-dom demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.