Skip to content

Commit

Permalink
docs: note limitations of not using shadow root (#8734)
Browse files Browse the repository at this point in the history
closes #8686
  • Loading branch information
dummdidumm authored Jun 14, 2023
1 parent 4f10637 commit c587c8a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion packages/playground/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ import { watch } from 'rollup';
import serve from 'rollup-plugin-serve';
import * as svelte from '../svelte/src/compiler/index.js';

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

/** @returns {import('rollup').Plugin}*/
function create_plugin(ssr = false) {
Expand Down
2 changes: 1 addition & 1 deletion site/content/docs/04-run-time.md
Original file line number Diff line number Diff line change
Expand Up @@ -1187,7 +1187,7 @@ el.name = 'everybody';

---

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:
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:

- `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>"`.
- `reflect: boolean`: By default, updated prop values do not reflect back to the DOM. To enable this behavior, set `reflect: true`.
Expand Down

0 comments on commit c587c8a

Please sign in to comment.