anki/ts/editor/WithColorHelper.svelte
2021-05-30 21:44:05 +02:00

24 lines
549 B
Svelte

<!--
Copyright: Ankitects Pty Ltd and contributors
License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
-->
<script lang="typescript">
import { colorHelperIcon } from "./icons";
export let color = "black";
function setColor(newColor: string): void {
color = newColor;
}
</script>
<div style={`--color-helper-color: ${color}`}>
<slot {colorHelperIcon} {color} {setColor} />
</div>
<style lang="scss">
div :global(#mdi-color-helper) {
fill: var(--color-helper-color);
}
</style>