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

@ -2,20 +2,14 @@
import "@spectrum-css/typography/dist/index-vars.css" import "@spectrum-css/typography/dist/index-vars.css"
// Sizes // Sizes
export let xl = false; export let size = "M"
export let l = false;
export let m = false;
export let s = false;
export let serif = false; export let serif = false
$: useDefault = ![xl, l, m, s].includes(true)
</script> </script>
<p class="spectrum-Detail" <p
class="spectrum-Detail spectrum-Detail--size{size}"
class:spectrum-Detail--serif={serif} 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 /> <slot />
</p> </p>