embed svgs from build script to support dark mode

This commit is contained in:
James Fenn
2023-06-24 18:26:12 -04:00
parent 4458f73e32
commit 7ad14469cc
4 changed files with 9 additions and 12 deletions

View File

@@ -1,5 +1,9 @@
/** @jsxRuntime automatic */
import { Node, Element } from "hast";
import { fromHtml } from "hast-util-from-html";
import { promises as fs } from "fs";
const chevron_down = await fs.readFile("src/icons/chevron_down.svg", "utf8");
interface HintProps {
title: string;
@@ -11,6 +15,7 @@ export function Hint({ title, children }: HintProps): Element {
return (
<details class="hint">
<summary class="hint__title text-style-body-medium-bold">
{fromHtml(chevron_down)}
{title}
</summary>