mirror of
https://github.com/ankitects/anki.git
synced 2025-09-20 23:12:21 -04:00

* Put PlainTextInput into its own directory * Create a directory for RichTextInput * Create editor-toolbar directory * Move PreviewButton into editor-toolbar * The time to refactor this is not quite yet here * Create tag-editor directory * Remove some of the uses of WithShortcut * Remove all uses of WithShortcut from editor package * Remove last uses of WithShortcut * Fix typo
22 lines
637 B
Svelte
22 lines
637 B
Svelte
<!--
|
|
Copyright: Ankitects Pty Ltd and contributors
|
|
License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|
-->
|
|
<script lang="ts">
|
|
import { getContext, onDestroy } from "svelte";
|
|
import { customStylesKey } from "./CustomStyles.svelte";
|
|
|
|
export let id: string;
|
|
export let href: string;
|
|
|
|
const { register, deregister } = getContext(customStylesKey);
|
|
|
|
function onLoad(event: Event): void {
|
|
const link = event.target! as HTMLLinkElement;
|
|
register(id, { element: link });
|
|
}
|
|
|
|
onDestroy(() => deregister(id));
|
|
</script>
|
|
|
|
<link {id} rel="stylesheet" {href} on:load={onLoad} />
|