budibase/packages/builder/src/components/userInterface/FlatButton.svelte

39 lines
736 B
Svelte
Raw Normal View History

2020-05-07 15:30:04 +02:00
<script>
export let value = ""
export let text = ""
export let icon = ""
export let onClick = value => {}
export let selected = false
$: useIcon = !!icon
</script>
<div class="flatbutton" class:selected on:click={() => onClick(value || text)}>
{#if useIcon}
<i class={icon} />
{:else}
<span>{text}</span>
{/if}
</div>
<style>
.flatbutton {
cursor: pointer;
2020-05-28 10:23:36 +02:00
padding: 8px 2px;
2020-05-07 15:30:04 +02:00
text-align: center;
background: #ffffff;
color: var(--ink-light);
border-radius: 5px;
2020-05-07 15:30:04 +02:00
font-family: Roboto;
2020-05-28 10:23:36 +02:00
font-size: 14px;
font-weight: 400;
transition: all 0.3s;
text-rendering: optimizeLegibility;
2020-05-07 15:30:04 +02:00
}
.selected {
2020-05-28 10:23:36 +02:00
background: var(--ink-light);
2020-05-07 15:30:04 +02:00
color: #ffffff;
}
</style>