anki/ts/editor-toolbar/ButtonDropdown.svelte

32 lines
805 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="typescript">
import type { ToolbarItem } from "./types";
import ButtonGroup from "./ButtonGroup.svelte";
export let id: string;
export let className = "";
function extendClassName(className: string): string {
return `dropdown-menu btn-dropdown-menu ${className}`;
}
export let items: ToolbarItem[];
</script>
2021-04-16 17:14:47 +02:00
<style>
:global(ul.btn-dropdown-menu) {
display: none;
2021-04-16 17:14:47 +02:00
background-color: var(--window-bg);
border-color: var(--medium-border);
}
:global(ul.btn-dropdown-menu.show) {
display: flex;
}
2021-04-16 17:14:47 +02:00
</style>
<ButtonGroup {id} className={extendClassName(className)} {items} />