2021-03-29 17:32:43 +02:00
|
|
|
<script lang="typescript">
|
2021-03-30 18:57:50 +02:00
|
|
|
export let id = "";
|
|
|
|
export let className = "";
|
|
|
|
export let props: Record<string, string> = {};
|
|
|
|
|
2021-03-29 17:32:43 +02:00
|
|
|
export let onChange: (event: ChangeEvent) => void;
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss">
|
2021-03-29 21:05:30 +02:00
|
|
|
button {
|
2021-03-29 17:32:43 +02:00
|
|
|
display: inline-block;
|
2021-03-29 21:05:30 +02:00
|
|
|
padding: 0;
|
2021-03-30 02:39:54 +02:00
|
|
|
|
|
|
|
&:hover {
|
|
|
|
background-color: #eee;
|
|
|
|
}
|
2021-03-30 03:17:36 +02:00
|
|
|
|
|
|
|
&:active {
|
2021-03-31 16:24:28 +02:00
|
|
|
box-shadow: inset 0 0 calc(var(--toolbar-size) / 2.5)
|
|
|
|
calc(var(--toolbar-size) / 7.5) rgb(0 0 0 / 30%);
|
2021-03-30 04:38:02 +02:00
|
|
|
border-color: #aaa;
|
2021-03-30 03:17:36 +02:00
|
|
|
}
|
2021-03-29 21:05:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
span {
|
|
|
|
display: inline-block;
|
2021-03-30 18:57:50 +02:00
|
|
|
vertical-align: middle;
|
2021-03-29 21:05:30 +02:00
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
2021-03-30 18:57:50 +02:00
|
|
|
|
2021-03-30 02:39:54 +02:00
|
|
|
cursor: pointer;
|
2021-03-29 17:32:43 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
input {
|
2021-03-30 18:57:50 +02:00
|
|
|
display: inline-block;
|
2021-03-29 17:32:43 +02:00
|
|
|
opacity: 0;
|
2021-03-31 16:24:28 +02:00
|
|
|
width: calc(var(--toolbar-size) - 6px);
|
|
|
|
height: calc(var(--toolbar-size) - 6px);
|
2021-03-30 18:57:50 +02:00
|
|
|
|
2021-03-30 02:39:54 +02:00
|
|
|
cursor: pointer;
|
2021-03-29 17:32:43 +02:00
|
|
|
}
|
|
|
|
</style>
|
|
|
|
|
2021-03-30 18:57:50 +02:00
|
|
|
<button tabindex="-1" {id} class={className} {...props} on:mousedown|preventDefault>
|
|
|
|
<span> <input type="color" on:change={onChange} /> </span>
|
2021-03-30 00:51:44 +02:00
|
|
|
</button>
|