From dbdc27df2246ec05c0e32cf7b461ddbe4223915f Mon Sep 17 00:00:00 2001 From: Vincent Fretin Date: Mon, 25 Mar 2024 20:56:24 +0100 Subject: [PATCH] Add example of using noShadowDOM() (#2108) --- packages/solid-element/README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packages/solid-element/README.md b/packages/solid-element/README.md index 6bd960fd7..3e466b8d8 100644 --- a/packages/solid-element/README.md +++ b/packages/solid-element/README.md @@ -41,6 +41,17 @@ Props get assigned as element properties and hyphenated attributes. This exposes This is all you need to get started with Solid Element. +A shadow DOM is used by default for style isolation. If you want to disable the shadow DOM, you can do it with `noShadowDOM()` like this: + +```jsx +import { customElement, noShadowDOM } from 'solid-element'; + +customElement('my-component', {someProp: 'one', otherProp: 'two'}, (props, { element }) => { + noShadowDOM(); + // ... Solid code +}) +``` + ## Examples [Web Component Todos](https://wc-todo.firebaseapp.com/) Simple Todos Comparison