convert Code component to new API
This commit is contained in:
parent
7dc53dc2e6
commit
2d8e200591
|
@ -1,20 +1,10 @@
|
|||
<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;
|
||||
export let xs = false;
|
||||
$: useDefault = ![xl, l, m, s, xs].includes(true)
|
||||
// Sizes
|
||||
export let size = "M"
|
||||
</script>
|
||||
|
||||
<code class="spectrum-Code"
|
||||
class:spectrum-Code--sizeXL={xl}
|
||||
class:spectrum-Code--sizeL={l}
|
||||
class:spectrum-Code--sizeM={m || useDefault}
|
||||
class:spectrum-Code--sizeS={s}
|
||||
class:spectrum-Code--sizeXS={xs}>
|
||||
<slot />
|
||||
<code class="spectrum-Code spectrum-Code--size{size}">
|
||||
<slot />
|
||||
</code>
|
Loading…
Reference in New Issue