adds defaults to Typography components

This commit is contained in:
Keviin Åberg Kultalahti 2021-04-21 13:21:43 +02:00
parent 6622d5a483
commit 7a6d4fd359
3 changed files with 6 additions and 6 deletions

View File

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

View File

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

View File

@ -8,14 +8,14 @@
export let s = 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"
class:spectrum-Detail--serif={serif} class:spectrum-Detail--serif={serif}
class:spectrum-Detail--sizeXL={xl} class:spectrum-Detail--sizeXL={xl}
class:spectrum-Detail--sizeL={l} class:spectrum-Detail--sizeL={l}
class:spectrum-Detail--sizeM={m} class:spectrum-Detail--sizeM={m || useDefault}
class:spectrum-Detail--sizeS={s}> class:spectrum-Detail--sizeS={s}>
<slot /> <slot />
</p> </p>