You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
svelte/test/runtime-browser/custom-elements-samples/reflect-attributes/main.svelte

26 lines
336 B

<svelte:options
customElement={{
tag: "custom-element",
props: { red: { reflect: true, type: "Boolean" } },
}}
/>
<script>
import "./my-widget.svelte";
export let red;
red;
</script>
<div>hi</div>
<p>hi</p>
<my-widget red white />
<style>
:host([red]) div {
color: red;
}
:host([white]) p {
color: white;
}
</style>