anki/ts/editor-toolbar/EditorToolbar.svelte

67 lines
1.6 KiB
Svelte
Raw Normal View History

2021-03-25 23:32:23 +01:00
<script lang="typescript">
import ButtonGroup from "./ButtonGroup.svelte";
2021-03-25 23:32:23 +01:00
2021-03-29 14:54:10 +02:00
import LabelButton from "./LabelButton.svelte";
import IconButton from "./IconButton.svelte";
2021-03-25 23:32:23 +01:00
2021-03-29 15:27:42 +02:00
import bracketsIcon from "./code-brackets.svg";
import paperclipIcon from "./paperclip.svg";
import micIcon from "./mic.svg";
import threeDotsIcon from "./three-dots.svg";
2021-03-29 21:05:30 +02:00
import {
boldButton,
italicButton,
underlineButton,
superscriptButton,
subscriptButton,
eraserButton,
} from "./format";
import { forecolorButton, colorpickerButton } from "./color";
export let buttons = [
[
{ component: LabelButton, label: "Fields..." },
{ component: LabelButton, label: "Cards..." },
],
[
boldButton,
italicButton,
underlineButton,
superscriptButton,
subscriptButton,
eraserButton,
],
[forecolorButton, colorpickerButton],
[
{ component: IconButton, icon: bracketsIcon },
{ component: IconButton, icon: paperclipIcon },
{ component: IconButton, icon: micIcon },
{ component: IconButton, icon: threeDotsIcon },
],
2021-03-29 14:54:10 +02:00
];
2021-03-25 23:32:23 +01:00
export let nightMode: boolean;
console.log(nightMode);
2021-03-25 21:11:40 +01:00
</script>
2021-03-30 00:51:44 +02:00
<style lang="scss">
div {
display: flex;
flex-wrap: wrap;
position: sticky;
top: 0;
left: 0;
z-index: 5;
padding: 2px;
background: var(--bg-color);
}
</style>
<div>
<ButtonGroup {buttons} />
</div>