1
0
Fork 0
mirror of synced 2024-07-12 17:56:07 +12:00
budibase/packages/standard-components/src/Heading.svelte

31 lines
858 B
Svelte
Raw Normal View History

<script>
import { buildStyle } from "./buildStyle.js"
export let className = ""
export let type
2020-04-22 22:52:55 +12:00
export let text = ""
export let _bb
let containerElement
$: containerElement &&
!text &&
_bb.props.children &&
_bb.props.children.length &&
_bb.attachChildren(containerElement)
</script>
2020-02-26 04:21:23 +13:00
{#if type === 'h1'}
<h1 class={className} bind:this={containerElement}>{text}</h1>
2020-02-26 04:21:23 +13:00
{:else if type === 'h2'}
<h2 class={className} bind:this={containerElement}>{text}</h2>
2020-02-26 04:21:23 +13:00
{:else if type === 'h3'}
<h3 class={className} bind:this={containerElement}>{text}</h3>
2020-02-26 04:21:23 +13:00
{:else if type === 'h4'}
<h4 class={className} bind:this={containerElement}>{text}</h4>
2020-02-26 04:21:23 +13:00
{:else if type === 'h5'}
<h5 class={className} bind:this={containerElement}>{text}</h5>
2020-02-26 04:21:23 +13:00
{:else if type === 'h6'}
<h6 class={className} bind:this={containerElement}>{text}</h6>
{/if}