adds defaults to Typography components

This commit is contained in:
Keviin Åberg Kultalahti 2021-04-21 13:21:43 +02:00
parent 7384e88613
commit 72fc3ea6dd
3 changed files with 6 additions and 6 deletions

View File

@ -12,7 +12,7 @@
export let xxs = false;
export let serif = false;
$: useDefault = ![xxxl, xxl, xl, l, m, s, xs, xxs].includes(true)
</script>
<p class="spectrum-Body"
@ -21,7 +21,7 @@
class:spectrum-Body--sizeXXL={xxl}
class:spectrum-Body--sizeXL={xl}
class:spectrum-Body--sizeL={l}
class:spectrum-Body--sizeM={m}
class:spectrum-Body--sizeM={m || useDefault}
class:spectrum-Body--sizeS={s}
class:spectrum-Body--sizeXS={xs}
class:spectrum-Body--sizeXXS={xxs}>

View File

@ -7,13 +7,13 @@
export let m = false;
export let s = false;
export let xs = false;
$: useDefault = ![xl, l, m, s, xs].includes(true)
</script>
<code class="spectrum-Code"
class:spectrum-Code--sizeXL={xl}
class:spectrum-Code--sizeL={l}
class:spectrum-Code--sizeM={m}
class:spectrum-Code--sizeM={m || useDefault}
class:spectrum-Code--sizeS={s}
class:spectrum-Code--sizeXS={xs}>
<slot />

View File

@ -8,14 +8,14 @@
export let s = false;
export let serif = false;
$: useDefault = ![xl, l, m, s].includes(true)
</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}
class:spectrum-Detail--sizeM={m || useDefault}
class:spectrum-Detail--sizeS={s}>
<slot />
</p>