Skip to content

Commit c587c8a

Browse files
authored
docs: note limitations of not using shadow root (#8734)
closes #8686
1 parent 4f10637 commit c587c8a

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

packages/playground/start.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ import { watch } from 'rollup';
44
import serve from 'rollup-plugin-serve';
55
import * as svelte from '../svelte/src/compiler/index.js';
66

7-
const __dirname = new URL('.', import.meta.url).pathname;
7+
let __dirname = new URL('.', import.meta.url).pathname;
8+
if (process.platform === 'win32') {
9+
__dirname = __dirname.slice(1); // else path.resolve fucks up
10+
}
811

912
/** @returns {import('rollup').Plugin}*/
1013
function create_plugin(ssr = false) {

site/content/docs/04-run-time.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1187,7 +1187,7 @@ el.name = 'everybody';
11871187

11881188
---
11891189

1190-
When constructing a custom element, you can tailor several aspects by defining `customElement` as an object within `<svelte:options>`. This object comprises a mandatory `tag` property for the custom element's name, an optional `shadow` property that can be set to `"none"` to forgo shadow root creation, and a `props` option, which offers the following settings:
1190+
When constructing a custom element, you can tailor several aspects by defining `customElement` as an object within `<svelte:options>`. This object comprises a mandatory `tag` property for the custom element's name, an optional `shadow` property that can be set to `"none"` to forgo shadow root creation (note that styles are then no longer encapsulated, and you can't use slots), and a `props` option, which offers the following settings:
11911191

11921192
- `attribute: string`: To update a custom element's prop, you have two alternatives: either set the property on the custom element's reference as illustrated above or use an HTML attribute. For the latter, the default attribute name is the lowercase property name. Modify this by assigning `attribute: "<desired name>"`.
11931193
- `reflect: boolean`: By default, updated prop values do not reflect back to the DOM. To enable this behavior, set `reflect: true`.

0 commit comments

Comments
 (0)