convert Detail component to new API

This commit is contained in:
Keviin Åberg Kultalahti 2021-04-30 13:39:42 +02:00
parent 2d8e200591
commit bf1173698e
1 changed files with 10 additions and 16 deletions

View File

@ -1,21 +1,15 @@
<script>
import "@spectrum-css/typography/dist/index-vars.css"
import "@spectrum-css/typography/dist/index-vars.css"
// Sizes
export let xl = false;
export let l = false;
export let m = false;
export let s = false;
// Sizes
export let size = "M"
export let serif = false;
$: useDefault = ![xl, l, m, s].includes(true)
export let serif = false
</script>
<p class="spectrum-Detail"
class:spectrum-Detail--serif={serif}
class:spectrum-Detail--sizeXL={xl}
class:spectrum-Detail--sizeL={l}
class:spectrum-Detail--sizeM={m || useDefault}
class:spectrum-Detail--sizeS={s}>
<slot />
</p>
<p
class="spectrum-Detail spectrum-Detail--size{size}"
class:spectrum-Detail--serif={serif}
>
<slot />
</p>