anki/ts/editor-toolbar/ColorPicker.svelte

32 lines
577 B
Svelte
Raw Normal View History

<script lang="typescript">
export let className: string;
export let onChange: (event: ChangeEvent) => void;
</script>
<style lang="scss">
2021-03-29 21:05:30 +02:00
button {
display: inline-block;
vertical-align: middle;
2021-03-29 23:02:20 +02:00
width: 30px;
height: 30px;
2021-03-29 21:05:30 +02:00
padding: 0;
}
span {
display: inline-block;
width: 100%;
height: 100%;
}
input {
opacity: 0;
width: 100%;
height: 100%;
}
</style>
2021-03-30 00:51:44 +02:00
<button>
<span class={className}> <input type="color" on:change={onChange} /> </span>
</button>