forked from tsai/budibase
8 changed files with 96 additions and 17 deletions
@ -1,23 +1,27 @@ |
|||||
<script> |
<script> |
||||
|
import { buildStyle } from "./buildStyle.js" |
||||
export let className = "" |
export let className = "" |
||||
export let type |
export let type |
||||
export let _bb |
export let _bb |
||||
export let text = "" |
export let text = "" |
||||
|
export let fontFamily = "" |
||||
|
|
||||
let containerElement |
let containerElement |
||||
|
|
||||
$: containerElement && !text && _bb.attachChildren(containerElement) |
$: containerElement && !text && _bb.attachChildren(containerElement) |
||||
|
$: style = buildStyle({ "font-family": fontFamily }) |
||||
</script> |
</script> |
||||
|
|
||||
{#if type === 'h1'} |
{#if type === 'h1'} |
||||
<h1 class={className} bind:this={containerElement}>{text}</h1> |
<h1 class={className} {style} bind:this={containerElement}>{text}</h1> |
||||
{:else if type === 'h2'} |
{:else if type === 'h2'} |
||||
<h2 class={className} bind:this={containerElement}>{text}</h2> |
<h2 class={className} {style} bind:this={containerElement}>{text}</h2> |
||||
{:else if type === 'h3'} |
{:else if type === 'h3'} |
||||
<h3 class={className} bind:this={containerElement}>{text}</h3> |
<h3 class={className} {style} bind:this={containerElement}>{text}</h3> |
||||
{:else if type === 'h4'} |
{:else if type === 'h4'} |
||||
<h4 class={className} bind:this={containerElement}>{text}</h4> |
<h4 class={className} {style} bind:this={containerElement}>{text}</h4> |
||||
{:else if type === 'h5'} |
{:else if type === 'h5'} |
||||
<h5 class={className} bind:this={containerElement}>{text}</h5> |
<h5 class={className} {style} bind:this={containerElement}>{text}</h5> |
||||
{:else if type === 'h6'} |
{:else if type === 'h6'} |
||||
<h6 class={className} bind:this={containerElement}>{text}</h6> |
<h6 class={className} {style} bind:this={containerElement}>{text}</h6> |
||||
{/if} |
{/if} |
||||
|
|||||
Loading…
Reference in new issue