2021-03-29 17:32:43 +02:00
|
|
|
<script lang="typescript">
|
2021-04-09 22:02:34 +02:00
|
|
|
export let id: string;
|
2021-03-30 18:57:50 +02:00
|
|
|
export let className = "";
|
2021-04-08 16:40:42 +02:00
|
|
|
export let tooltip: string;
|
2021-03-30 18:57:50 +02:00
|
|
|
|
2021-04-01 18:55:34 +02:00
|
|
|
export let onChange: (event: Event) => void;
|
2021-03-29 17:32:43 +02:00
|
|
|
</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-04-01 01:22:06 +02:00
|
|
|
<button
|
|
|
|
tabindex="-1"
|
|
|
|
{id}
|
|
|
|
class={className}
|
2021-04-08 16:40:42 +02:00
|
|
|
title={tooltip}
|
2021-04-01 01:22:06 +02:00
|
|
|
on:mousedown|preventDefault>
|
2021-03-30 18:57:50 +02:00
|
|
|
<span> <input type="color" on:change={onChange} /> </span>
|
2021-03-30 00:51:44 +02:00
|
|
|
</button>
|