anki/ts/components/ColorPicker.svelte

25 lines
601 B
Svelte
Raw Normal View History

2021-04-15 15:59:52 +02:00
<!--
Copyright: Ankitects Pty Ltd and contributors
License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
-->
<script lang="ts">
2021-05-30 22:58:40 +02:00
import { onMount, createEventDispatcher } from "svelte";
let inputRef: HTMLInputElement;
const dispatch = createEventDispatcher();
2021-05-30 22:58:40 +02:00
onMount(() => dispatch("mount", { input: inputRef }));
</script>
2021-05-30 22:58:40 +02:00
<input tabindex="-1" bind:this={inputRef} type="color" on:change />
<style lang="scss">
input {
display: inline-block;
2021-05-30 22:58:40 +02:00
width: 100%;
height: 100%;
cursor: pointer;
opacity: 0;
}
</style>