2020-02-14 12:51:45 +01:00
|
|
|
<script>
|
2020-04-27 12:26:34 +02:00
|
|
|
import { buildStyle } from "./buildStyle.js"
|
2020-02-14 12:51:45 +01:00
|
|
|
export let className = ""
|
|
|
|
export let type
|
2020-04-22 12:52:55 +02:00
|
|
|
export let text = ""
|
2020-05-19 18:00:53 +02:00
|
|
|
|
|
|
|
export let _bb
|
2020-04-27 12:26:34 +02:00
|
|
|
|
2020-02-14 12:51:45 +01:00
|
|
|
let containerElement
|
|
|
|
|
2020-07-08 15:33:48 +02:00
|
|
|
$: containerElement && !text && _bb.props.children && _bb.props.children.length && _bb.attachChildren(containerElement)
|
2020-02-14 12:51:45 +01:00
|
|
|
</script>
|
|
|
|
|
2020-02-25 16:21:23 +01:00
|
|
|
{#if type === 'h1'}
|
2020-05-19 18:00:53 +02:00
|
|
|
<h1 class={className} bind:this={containerElement}>{text}</h1>
|
2020-02-25 16:21:23 +01:00
|
|
|
{:else if type === 'h2'}
|
2020-05-19 18:00:53 +02:00
|
|
|
<h2 class={className} bind:this={containerElement}>{text}</h2>
|
2020-02-25 16:21:23 +01:00
|
|
|
{:else if type === 'h3'}
|
2020-05-19 18:00:53 +02:00
|
|
|
<h3 class={className} bind:this={containerElement}>{text}</h3>
|
2020-02-25 16:21:23 +01:00
|
|
|
{:else if type === 'h4'}
|
2020-05-19 18:00:53 +02:00
|
|
|
<h4 class={className} bind:this={containerElement}>{text}</h4>
|
2020-02-25 16:21:23 +01:00
|
|
|
{:else if type === 'h5'}
|
2020-05-19 18:00:53 +02:00
|
|
|
<h5 class={className} bind:this={containerElement}>{text}</h5>
|
2020-02-25 16:21:23 +01:00
|
|
|
{:else if type === 'h6'}
|
2020-05-19 18:00:53 +02:00
|
|
|
<h6 class={className} bind:this={containerElement}>{text}</h6>
|
2020-02-14 12:51:45 +01:00
|
|
|
{/if}
|