anki/ts/editor-toolbar/ColorPicker.svelte

43 lines
829 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;
width: 28px;
height: 28px;
2021-03-29 21:05:30 +02:00
padding: 0;
&:hover {
background-color: #eee;
}
2021-03-30 03:17:36 +02:00
&:active {
box-shadow: inset 0 0 12px 4px rgb(0 0 0 / 30%);
border-color: #aaa;
2021-03-30 03:17:36 +02:00
}
2021-03-29 21:05:30 +02:00
}
span {
display: inline-block;
width: 100%;
height: 100%;
cursor: pointer;
}
input {
opacity: 0;
width: 100%;
height: 100%;
cursor: pointer;
}
</style>
2021-03-30 03:05:21 +02:00
<button tabindex="-1">
2021-03-30 00:51:44 +02:00
<span class={className}> <input type="color" on:change={onChange} /> </span>
</button>