budibase/packages/standard-components/src/Text.svelte

40 lines
602 B
Svelte
Raw Normal View History

<script>
import { getContext } from "svelte"
const { styleable } = getContext("sdk")
const component = getContext("component")
export let text = ""
export let bold = false
export let italic = false
export let underline = false
let element
</script>
<p
bind:this={element}
use:styleable={$component.styles}
class:bold
class:italic
class:underline
>
{text}
</p>
<style>
2021-02-23 11:04:07 +01:00
p {
display: inline-block;
2021-02-23 11:04:07 +01:00
white-space: pre-wrap;
}
.bold {
font-weight: bold;
}
.italic {
font-style: italic;
}
.underline {
text-decoration: underline;
}
</style>